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.