ROMULUS (WWJ) – An American Airlines co-pilot who was charged with being drunk in the cockpit at Detroit Metro Airport has reached a plea deal with prosecutors.

John Francis Maguire of Pennsylvania pleaded no contest to operating an aircraft under the influence and was sentenced to a year probation, according to the Wayne County Prosecutor’s Office, which he will be allowed to serve in his home state.

READ MORE: Kellogg's Being Sued Over Strawberry Pop-Tarts

In addition, the 50-year-old was ordered to enter an alcohol treatment program and perform 48 hours of community service within 120 days.

If he violates probation, Maguire will spend 45 days in jail.

READ MORE: Target To Open Store In Midtown Detroit

Police were alerted by TSA officers that Maguire was suspected of being under the influence of alcohol while in the cockpit of a plane preparing to take off the morning of Saturday, March 26.

Airport officials said a field sobriety test was given, and he was taken into custody on the tarmac. A breathalyzer test administered by police then confirmed that Maguire was over the legal limit.

MORE NEWS: City of Hamtramck To Handout Water Filters On Oct.26

Flight-736 — which was scheduled to take off just before 7 a.m. for Philadelphia — was postponed and travelers were put on other flights.