NEW YORK — A jammed lock on an airplane bathroom door caused anxious moments for the pilots aboard a flight from North Carolina to New York City.

The captain told air traffic controllers he accidentally got stuck on the LaGuardia Airport-bound Chautauqua Airlines flight from Asheville on Wednesday night.

When a passenger with an unfamiliar accent tried to alert the co-pilot in the cockpit, the co-pilot became alarmed and notified air traffic controllers, according to a recording of the radio exchange from the website

“The captain has disappeared in the back and I have someone with a thick foreign accent trying to access the cockpit right now, and I’ve got to deal with this situation,” the co-pilot says.

A controller tells him to consider declaring an emergency.

“OK, Chautauqua, you guys ought to declare an emergency and just get on the ground,” a controller says.

The captain eventually got himself free from the lavatory. He told controllers there was no threat.

“The captain — myself — went back to the lavatory and the door latched ... and had to fight my way out of it with my body to get the door open,” the captain says. “There is no issue, no threat.”

A spokesman for Indianapolis-based Republic Airways Holdings, which runs Chautauqua, did not immediately comment on the misunderstanding.