Prosecutors said James, 36, handed over a carry-on bag for inspection at Newark Liberty International Airport about 6 p.m. on March 9.
As he was waiting for his bag to be screened, James allegedly asked that TSA examine the bag quickly because he was going to miss his flight to San Francisco, prosecutors said.
A TSA agent spotted what looked like a firearm in James' bag and called Port Authority police.
But when James saw that his bag was being scrutinized, he left the airport security area, ditching his luggage, driver's license and boarding pass, and left the airport in a taxi, prosecutors said.
Investigators found a Derringer .38-caliber handgun, loaded with two rounds, inside James' bag, prosecutors said.
He was prohibited from possessing a firearm due to a 2013 drug conviction.
James surrendered himself to law enforcement early Monday morning. He appeared before a judge that afternoon.
No cameras were allowed inside the federal courtroom. James stood before United States Magistrate Judge Joseph Dickson with shackles on his wrists and ankles. He was accompanied by a public defender as his attorney Brian Nearly could not be at his first appearance.
James faces one count of possession of a firearm by a convicted felon and one count of carrying a weapon on an aircraft. Each charge carries a maximum potential sentence of 10 years in prison.
The federal government wants to keep him behind bars pending a bail hearing, which is scheduled for March 26.