A man was sentenced to 18 months in federal prison on Wednesday after he jumped out of a moving plane at Los Angeles International Airport last year.

A United Airlines bound flight for Salt Lake City was taxiing when the passenger, 34-year-old Luis Armando Victoria Dominguez of Mexico, “sprinted” to the front of the aircraft and started banging on the door and trying to breach the cockpit, the U.S. Attorney’s Office said.

When he couldn’t get in, Dominguez assaulted a flight attendant who tried to stop him and then he went to the emergency exit and opened the door, deploying the emergency slide, according to authorities.

The pilot quickly shut off the plane’s engine to avoid the slide being sucked into the engine.

A nearby passenger tried to restrain Dominguez, but he managed to get away and jump from the aircraft, missing the slide.

He landed onto the tarmac and started crawling away, his leg broken.

Dominguez pleaded guilty in October last year to one count of interference with flight crew members and a flight attendant.

In addition to time in prison, he was ordered to pay more than $20,000 in restitution.

The plane was taken out of commission for four days because of the damage that was left behind, officials said.

Dominguez later told authorities he had smoked “a lot” of crystal meth before heading to the airport.

He told the FBI that he panicked when he heard other passengers laugh and say they were going to a different destination, according to a criminal complaint

He said his panic attack possibly “gave him the strength to open the door.”