Irfan Faiz, 54, had been due to captain a flight to Islamabad on Wednesday night and was carrying out pre-flight checks when staff at the airport noticed he was “unsteady on his feet and smelt of intoxicants”. The plane had 180 passengers on board.

The Pakistan International Airlines pilot, who was chewing gum and had consumed mints to hide the odour, admitted one charge of carrying out "an activity ancillary to an aviation function while impaired by drink".

Martin Townend, prosecuting, told Leeds Magistrates' Court: "He did gain access to the cockpit of the aircraft when he was stopped by managers, who contacted police, who arrested him.

"There was a potential for the plane to have been piloted by a drunk pilot. That would have been dangerous for the passengers, and people living in the UK, as that plane could have potentially crashed."

Yousuf Khan, representing Faiz, told the court that Mr Faiz registered 41mg of alcohol per 100ml when breathalysed – well over the legal limit for flying of 9mg – but said his client had an unblemished record as a pilot.

Mr Faiz, who has been flying for 25 years, faces a maximum sentence of two years in prison. He was remanded in custody and will be sentenced at Leeds Crown Court on October 18.

Magistrates told Mr Faiz he had “breached the trust of the public”, adding that “the consequences could have been serious loss of life."

A spokesman for the Civil Aviation Authority told the BBC: "A pilot attempting to fly while under the influence of alcohol or illegal drugs is a major threat to flight safety.

"At UK airports the police have legal powers to test pilots for drink and drugs. Such incidents, however, are very rare."

Pakistan International Airlines is the national flag carrier of Pakistan, and a state-owned company. It has a fleet of 34 aircraft and flies from Leeds Bradford, Manchester, Birmingham and Heathrow.