A federal judge has sentenced Passaic County rapper LaRon James to more than two years in prison for trying to bring a loaded handgun on a plane at Newark Liberty International Airport

James, who lives in Totowa and performs under the name Juelz Santana, pleaded guilty in August to possessing a firearm as a convicted felon and carrying a weapon on an aircraft.

U.S. District Judge Stanley R. Chesler on Wednesday sentenced James, a 36-year-old Totowa resident, to 27 months in prison and one year of supervised release, according to the U.S. Attorney’s Office for the District of New Jersey.

James, who was represented by defense attorney Brian Neary, is best known for the hit single “There It Go (The Whistle Song)," and has in recent years appeared on the VH1 reality show Love & Hip Hop. He has worked with Chris Brown

He’s also had his share of legal troubles, including a 2012 felony conviction in Bergen County for drug distribution.

Port Authority police detectives arrested James in March after Transportation Security Administration (TSA) agents discovered a loaded .38-caliber derringer handgun in the rapper’s bag as he tried to board a flight to San Francisco.

James appeared nervous at the security checkpoint and had asked TSA agents to screen his bag quickly so he wouldn’t miss his flight, according to a criminal complaint filed with the court.

Authorities said he later fled the airport in a taxi cab, but was arrested less than three days later.

Thomas Moriarty may be reached at tmoriarty@njadvancemedia.com. Follow him on Twitter at @ThomasDMoriarty. Find NJ.com on Facebook.