A judge sentenced a Queens man Thursday to 11 years behind bars for a Christmastime robbery at Roosevelt Field mall that sent shoppers scrambling for safety when the assailant’s gun fired during a struggle with a security guard.

Oliver Lee of Little Neck pleaded guilty in June to robbery and assault charges from the Dec. 22, 2015, crime at the Garden City shopping center.

Prosecutors said Lee, who turns 23 Friday, brandished a .380-caliber semiautomatic handgun in the mall’s Tourneau store after asking to see a Rolex watch worth more than $18,000.

A store security guard who is a retired NYPD detective sergeant then confronted Lee and the two got into a struggle before a bullet discharged and hit a 69-year-old Macy’s employee, according to authorities. The bullet lodged in the back of the employee’s neck but authorities said it didn’t seriously injure him and he spent one day in the hospital.

Police said two unarmed mall security guards helped in the apprehension by restraining Lee, before an off-duty NYPD inspector also helped to handcuff him.

Prosecutor Veronica Guariglia asked for a 20-year prison sentence, and told the judge Thursday the day of the robbery was one the shooting victim “will never forget.” She said the encounter with Lee still gives one of the Tourneau employees nightmares.

advertisement | advertise on newsday

She said the store security guard who first confronted Lee Kenneth Krug is happy to put it all behind him and “feels that justice has been done.”

State Supreme Court Justice William Donnino said while sentencing Lee that he had considered the trauma the victims had suffered, and that Lee had perpetrated a serious crime in a shopping area. The judge said he also took into account Lee’s age at the time, that he had no prior criminal record, and that by law, the shooting victim didn’t suffer a serious injury.

Defense attorney Aida Leisenring said after court that her client is “extremely grateful that no one was seriously injured,” and that “years of severe untreated substance addiction” led Lee to that day, and now, his prison sentence.

But she said her client also was grateful for his newfound sobriety, and remorseful for his actions.

“What’s important here is that he accepted full responsibility,” the Garden City attorney said.

Nassau District Attorney Madeline Singas said in a prepared statement that Lee terrorized holiday shoppers and shot an innocent mall employee, but “will pay for his crime behind bars” thanks to the retired NYPD official who apprehended him.