Two executives with an Indonesian budget airline have resigned after the release of disturbing footage showing an Indonesian pilot staggering through an airport metal detector en route to the cockpit of his plane.

Citilink had denied the pilot was drunk when initial reports emerged on Wednesday but suspended him following the release of the footage. He was later sacked.

In the footage the pilot is barely able to walk through the security check at Juanda International Airport in Surabaya, and struggles to collect his belongings from the X-ray conveyor belt.

Incredibly, captain Tekad Purna was allowed to board the plane but passengers rioted when they heard him over the PA.

Mobile phone footage filmed by a passenger captured the chaos in the cockpit.

Some of the passengers left the plane when it appeared that the pilot was going to be allowed to fly. He was eventually replaced with another pilot.

Citlink is the low-cost subsidiary of Garuda — Indonesia's national carrier.

President director of Citilink Albert Burhan and operational director Hadinoto Soedigno resigned two days after the incident.

The flight from Surabaya to Jakarta eventually departed an hour behind schedule with 154 passengers on board.