A man accused of using an expired boarding pass with someone else's name to get on a flight from New York to Los Angeles has agreed to plead guilty to a stowaway charge and pay $942 for the cross-country flight.

Olajide Oluwaseun Noibi, 24, will enter his plea in federal court to the felony count next Tuesday, said Thom Mrozek, a spokesman for the U.S. Attorney's office.

Noibi faces up to five years in prison when he is sentenced.

Prosecutors agreed to drop a second felony charge that Noibi tried to enter a secure area of an airport by fraud or false pretense. He could have faced up to 15 years in prison if convicted of that and the stowaway charge.

In his plea agreement, Noibi admitted that he boarded a Virgin America flight in New York on June 24 using an expired boarding pass with someone else's name on it. The airline crew didn't realize until mid-flight that an extra passenger was onboard in a premium seat that was supposed to be empty.

Noibi was arrested several days later at Los Angeles International Airport when he tried to board a Delta flight to Atlanta with an expired pass.

His case sparked security concerns after it was determined that he got past airport screenings by using expired boarding passes with someone else's name and presenting his student identification.

According to the agreement, prosecutors did not find that terrorism charges applied to this case. Noibi has dual citizenship in the U.S. and Nigeria, and court documents showed he didn't appear to have a permanent residence.