TVC E. Grammy-winning rapper Coolio pleaded guilty on Wednesday to unlawful firearm possession for carrying a loaded pistol in a backpack into Los Angeles International Airport last month and was sentenced to three years of probation, prosecutors said.

The 53-year-old recording star, whose legal name is Artis Leon Ivey, was also ordered to perform 45 days of community service under a negotiated plea deal sparing him from prison, according to a spokesman for the Los Angeles County District Attorney’s Office.

The rap artist was charged earlier this month with illegal possession of a firearm by a convicted felon, an offense that carries a penalty of up to three years in prison.

At his hearing in Los Angeles County Superior Court on Wednesday, he pleaded guilty to the lesser offense of carrying a concealed weapon.

Ricardo Santiago, a spokesman for prosecutors, said the rapper could return to court in a year to have his latest felony conviction reduced to a misdemeanor, provided he fulfills his community service obligation by then and stays out of trouble with the law.

READ THIS:  Why Ooni Ogunwusi marries new wife

He already had two prior felony convictions on his record, from 2001 for carrying a concealed weapon in a vehicle and in 2009 for possession of cocaine.

The judge told Coolio on Wednesday that if he were found to be in possession of even a single bullet during the next three years, he would end up back in court facing jail time for violating his probation.

The rap star sounded a note of contrition in remarks to reporters after the hearing, but said his latest brush with the law resulted from a “mistake.”

READ THIS:  2016 AFRIMA Batch A nominees list unveiled

“It was a misunderstanding,” he said. “I do not condone the use of firearms, legal or illegal. Thanks to the court and the attorneys handing this for me so I can still do the work that I do.”

According to police who arrested Coolio at the airport on Sept. 17, a stolen, loaded handgun was discovered in his backpack on the X-ray screening belt as his entourage was going through security to board a flight en route to a concert.

Coolio, a Los Angeles-area native, is perhaps best known for this 1995 Grammy Award-winning hit “Gangsta’s Paradise,” the No. 1 U.S. chart-topper that year and one of the best-selling singles of all time.