Rapper Juelz Santana was sentenced Wednesday to 27 months in prison for trying to take a loaded gun onto a flight leaving Newark Airport in March.

The Totowa resident, whose real name is LaRon James, pleaded guilty in federal court in Newark in August to weapon possession by a convicted felon and carrying a weapon on an aircraft, court documents say.

Santana, who remained out on bail, has been allowed to travel but was watched by the government. He had to return home at certain times to meet a curfew, according to court documents. In addition to performing in New York City, the Harlem native has been filming the reality television show “Love and Hip Hop,” which airs on VH1.

On March 9, the “There It Go” performer arrived at Newark Airport at 6 p.m. for a 6:25 p.m. flight to San Francisco, authorities said.

During an X-ray screening of his bag, "a Transportation Security Administration agent identified a suspected firearm," court documents say. Santana then "retreated from the security checkpoint area without his belongings. He left behind a .38-caliber handgun, a New York State driver's license and two bags."

A search ensued to find Santana after he left the airport, authorities said. He turned himself in to police about two days later.

Santana has had run-ins with law enforcement in the past.

He was previously charged in 2011 with weapons possession and drug offenses. He pleaded guilty to a marijuana distribution charge, court records show. In two other incidents, he pleaded guilty to violating a restraining order.

After his sentencing Wednesday, Santana will not immediately go to prison, having reached an agreement with the government to let him perform on Long Island. It's not known when he will be required to turn himself in to authorities.

Hackensack:Hospital to construct 43,500-square-foot utility plant

Priest scandal:Four on Jesuit list of predators have New Jersey ties

Phil Murphy hiring investigation:Sexual assault probe raises more questions than answers