OTTAWA — It was 7 a.m., and 99 passengers and six crew members were aboard a 737 on the tarmac at Calgary International Airport, bound for a sunny holiday in Cancun, Mexico. There was one problem, however. The flight’s captain was passed out in the cockpit, apparently from drinking.

The police in Calgary, Alberta, arrested the pilot, Miroslav Gronych, 37, on Saturday and have charged him with two alcohol-related offenses.

“This is a new one, and obviously this had a very significant potential to cause great harm had the pilot actually been allowed to fly this plane,” Staff Sgt. Paul Stacey of the Calgary Police Service said at a news conference. “There’s just so many checks and balances, it just doesn’t surprise me that he got caught before this plane was able to leave the gate.”

Nevertheless, Inspector Ken Thrower, the commander of the Calgary Police Service’s traffic and airport unit, said his officers, along with airport officials and inspectors from Transport Canada, the aviation regulator, will begin trying to figure out how the pilot managed to pass through several checkpoints, including airport security, while obviously inebriated.