COLUMBUS, Ga. — A judge and prosecutor said Friday that a five-year sentence given to a Georgia teen who stole a pair of pricey shoes was appropriate because a gun was used during the robbery.

Dayonn Davis, who was 18 when he was sentenced this week to five years in prison followed by 10 years of probation, was charged as an adult even though he was 15 when the crime was committed and his lawyer said he had no prior record. The sentence has sparked outrage and controversy on social media.

Prosecutor Sadhana Dailey said in court that Davis contacted the owner of the Nike Oreos — so called because they're black and white — after seeing them for sale on Facebook, according to the Ledger-Enquirer. They arranged to meet at a Columbus park on Jan. 17, 2016.

Get Breaking News Delivered to Your Inbox

Another male went with Davis to the meeting. When Davis tried the shoes on, he told the seller, "These shoes is took." The other male pulled out a gun and everyone fled, the newspaper reports.

"This was an armed robbery. It's not a theft. There's a big difference between a theft and an armed robbery," Dailey told The Associated Press on Friday in a phone interview. "The teen victim was robbed at gunpoint."

Columbus police quickly identified Davis, who had the shoes in his closet.

Davis initially told police no one else was involved but eventually gave a name, but the seller of the shoes couldn't identify the person in a photo lineup as the gunman, the newspaper reported.

Davis was charged with armed robbery and reached a deal with prosecutors to plead guilty to robbery by force, which allowed him to avoid the mandatory 10-year sentence that comes with an armed robbery conviction, Dailey said.

"He got a break," she said.

Defense attorney Susan Henderson told Muscogee County Superior Court Judge Bobby Peters her client just wants to put the whole thing behind him and move on, the Ledger-Enquirer reported.

"He's been extremely remorseful," she said. "He's got his life on track now."

She insisted Davis didn't know the other person would pull a gun. But the judge says that makes little difference in the eyes of the law.

"I was young at the time, so I wasn't in my right mind," Davis told the judge.

Judge Peters called the case an unfortunate situation and told the AP he would rather it have been handled in juvenile court. Dailey said it was appropriate to charge Davis as an adult because of the seriousness of the crime.

Peters told the AP that Davis will likely be released on parole before completing his five-year sentence. Because it's a first offense, Davis' record can be expunged if he successfully completes probation, Peters said.

No one else has been charged in the case. It's not clear whether the person Davis identified as the gunman was actually the other person who was there, Dailey said.