An Air India aircraft was forced to land after the pilot was locked out of the cockpit during a toilet break.

He was unable to gain access to the cockpit because of a jammed door, the BBC reported

The flight from Delhi to Bangalore was diverted to Bhopal airport on Monday.

“The commander of the flight had left the cockpit for a short while to visit the toilet and on returning to the cockpit found the door locked. The door had got jammed and all efforts to open the door even from inside by the co-pilot failed,” Air India said.

“The co-pilot, after taking permission from ground control, diverted the flight to Bhopal and landed … at 1755 hrs.”

The door was fixed by ground maintenance engineers and the aircraft continued its journey less than three hours later, according to Air India.

The airline is currently investigating a separate incident in which the auto-pilot system of Airbus 321 flying from Bangkok to Delhi on April 12 was accidently switched off.

Air India has denied claims in the Mumbai Mirror that two pilots had taken a 40-minute break from the cockpit and left two cabin crew in their seats to operate the plane in their absence.

One of the crew accidentally turned off the auto-pilot, forcing the pilots to rush back to their seats, the report said.

Air India said cabin crew did “overstay” in the cockpit and that the autopilot was briefly disconnected “due to distraction”.