He must have been afraid of flying?

A pilot sparked a security incident on Wednesday evening after accidentally locking himself in the toilet on a flight to New York.

The incident occurred on a Chautauqua Airlines flight from Asheville, North Carolina, after the latch on the toilet door jammed as the plane was about to land.

A passenger heard the pilot knocking on the bathroom door and, after being given the password, went to the cockpit to speak to inform the rest of the crew.

"Someone with a thick foreign accent is giving me a password to access the cockpit, and I'm not about to let him in," the co-pilot can be heard saying on an audio recording.

The co-pilot had previously reported his captain missing over the radio and fighter jets were almost sent to follow the plane.

The pilot managed to free himself and returned to the cockpit and radioed control to say: "The captain - myself - went back to the lavatory and the door latched.

"[I] had to fight my way out of it with my body to get the door open... There is no issue, no threat."

The craft was landed safely in New York and was met by the authorities at around 6.30pm local time.

"The first officer did the right thing in securing the flight deck when he was not able to personally confirm the status of the aircraft's captain," a statement from Chautauqua Airlines read.

"No-one was ever in danger, and everyone, including the good Samaritan who tried to help the captain, as well as the crew, are to be commended for their actions."