A former pilot accused of attempting to shut off the engines of a passenger jet mid-flight has pleaded guilty to the charges in a federal court.

Joseph David Emerson was riding off-duty in the cockpit of an Alaska Airlines flight when he told the pilots I am not okay before trying to cut the engines midair, court documents showed.

Emerson also told police he had taken psychedelic mushrooms and had been struggling with depression.

Under his plea agreement, prosecutors can recommend a one-year prison sentence, while his attorneys are expected to argue for no additional jail time.

He pleaded no-contest to reckless endangerment and first-degree endangering an aircraft in Oregon state court, and guilty in federal court, according to the BBC's US partner CBS News.

In the state court, he was sentenced to 50 days in jail, which he has already served, five years' probation, 664 hours of community service - eight hours for each person he endangered - and $60,659 (£44,907) in restitution. Deputy District Attorney Eric Pickard remarked on the recklessness of his actions, highlighting how close he came to ruining the lives of not just the 84 people aboard Flight 2059, but their families as well.

In court on Friday, Emerson stated he had been unable to perceive reality after taking the mushrooms, but recognized that this didn't justify his actions. He mentioned how this experience had made him a better father and husband.

The flight on October 22, 2023, was diverted to Portland, Oregon, after the incident. The criminal complaint detailed that one pilot had to physically subdue Emerson, who attempted to reach for the emergency exit during the plane's descent.

Flight attendants reported Emerson stating, I messed everything up and even claimed he tried to kill everyone on board. Following the incident, Emerson founded a non-profit for pilot health with his wife and must adhere to probation rules which include avoiding drugs and maintaining a distance from operational aircraft. His sentencing in the federal case is scheduled for November 17.