RALEIGH, N.C. – A man accused of robbing former “American Idol” star Scotty McCreery and his friends was sentenced to at least 17 years in prison on Tuesday in a Wake County courtroom.

Mikkail Shaw pleaded guilty to eight counts, including first-degree burglary and second-degree kidnapping Monday as well as robbery with a dangerous weapon and conspiracy to commit robbery.

Shaw turned to McCreery and his friends and asked for forgiveness in court Tuesday.

According to search warrants, two pistols and an AK-47 were used in the robbery at a Raleigh apartment in May 2014. The state had been preparing for trial but Shaw decided to plead guilty.

McCreery has described how he and some friends were having pizza late at night when Shaw and others barged in and one man pointed a pistol at McCreery’s head.

McCreery and his friends did not testify Tuesday. But Shaw’s grandfather, Hite Ali Abdul Malik, did testify and said his grandson was not a criminal but someone who got caught up in the wrong crowd.

“He’s been misled by other people, he is not a leader he is a follower,” the grandfather said. “And may God forgive him. And may the families and all those involved forgive him.”

The other robbers have not been caught, and Shaw has refused to say who he was with that night.

Prosecutor Jason Waller on Monday gave some details on the terrifying night for McCreery and his friends.

“They put all the guys in the living area and made them get down on the knees said, ‘Give me your wallets your cellphones’ and made them lay facedown on the stomach on the living room floor,” Waller said.