A drunk pilot allegedly passed out in the cockpit just moments before take off with 99 passengers on board.

Airport staff and cabin crew noticed Miroslav Gronych was behaving "oddly" shortly before he became unconscious, police said.

The 37-year-old Slovakia was escorted from the Sunwing Airlines plane in Calgary, Canada on New Years Eve and arrested.

Calgary Police said he was charged with having care and control of an aircraft while impaired. Gronych had more than 80 mgs of alcohol per 100mL of blood, the force added.

In a Facebook post, Sunwing Vacations apologised to its customers and assured them that "safety remains our utmost priority".

The company added that it was able to find a new captain and its passengers were able to make their planned journey to Cancun in Mexico with "minimal delay".