A driver who participated in a 2014 street race that killed five other teens was sentenced Friday to six months in jail, despite pleas from prosecutors who said he made insensitive social media posts the day of his guilty plea.

Prosecutors had pressed for one to three years for Cory Gloe, citing the social media posts that included one disparaging police. Gloe also got re-arrested on a weapons charge, which was later dropped.

The judge nevertheless granted youthful offender status because Gloe was 17 at the time of the crash. The announcement prompted gasps in the Long Island courtroom, which was packed with victims' families and a crash survivor.

Gloe, now 19, apologized as he was sentenced to the jail term and five years' probation.

He pleaded guilty in March to a 17-count indictment that included five manslaughter charges in exchange for the six-month sentence.

Gloe was one of two drivers engaging in a drag race in Farmingdale in May 2014. The driver and four passengers in the other car died when that vehicle crashed into an oncoming SUV. Prosecutors said Gloe goaded the other driver into racing.

The day Gloe pleaded guilty, he posted messages using an epithet about the police and claiming "I'll be in and out faster than you can spin a doubt."

The social media posts came to light earlier this month during a separate court case involving Gloe.

The judge warned Gloe in March that his promise of a six-month term would be revoked if Gloe got into any more trouble. He was arrested days later during a traffic stop in which he was a passenger. He was charged with a felony after police found a gravity knife in the vehicle, but those charges were later dismissed after prosecutors said the driver of the vehicle admitted to owning the knife.

The mother of one of the teens killed in the 2014 crash had argued that the six-month sentencing agreement should still have been vacated because Gloe was arrested despite the judge's admonitions.

Sandra Lonnborg also said the social media posts represented "a blatant disregard for the law, for the judge's decision."

An Instagram post provided by Lonnborg showed Gloe posing for a selfie outside the Nassau County courthouse and a caption using an expletive about the police. There also were posts that had emojis depicting a middle finger and a police car.