A Frontier Airlines flight heading to Chicago on Sunday had to divert to Miami after a passenger began acting erratically, choking a flight attendant and attempting to open an emergency door.

Officials say that 51-year-old Juan Gabriel Reyes has been charged with interference with flight crew members and attendants, as well as assault within maritime and territorial jurisdiction. He's been given a federal public defender and has yet to enter a plea.

About 45 minutes into a flight from San Juan, Puerto Rico to Chicago-O’Hare International Airport, Reyes became "disruptive", saying he wanted to get off the plane and trying to open an emergency exit door.

After he was stopped from trying to open the cabin door, he went to the cockpit and began “shoving his shoulder aggressively on the pilot’s door,” the documents say.

A flight attendant ushered him away from the pilot's door and let him use the restroom on his way back to his seat. Reyes reportedly tried to urinate on the bathroom floor. He was escorted to a new seat, where an off-duty flight attendant volunteered to sit with him.

The off-duty flight attendant moved his belongings and went to use the restroom, but Reyes tried to grab the man's bag off the floor. When he asked Reyes to stop and moved to a seat across the aisle. Reyes "got on top of the victim" and “grabbed the victim by the head and choked him."

Several passengers worked together with on-duty attendants to restrain Reyes with flex cuffs, which he broke out of several times, and seatbelt extenders.

John Longood, a Brazillian Jiu-Jitsu instructor who was also travelling to Chicago, said he was one of the passengers who helped restrain Reyes.

“What are the chances?” he said. “That’s why I train. That’s why I do Jiu-Jitsu, so I can handle myself in a real-life situation like that.”

Longood said he saw Reyes try to attack the off-duty flight attendant and jumped into action, restraining him in his row and tying him up with a seatbelt.

“I’m just lucky I was in the seat that I was in because I knew that I could take care of it and handle it without him or anybody else getting injured,” Longood told WLS.

The flight redirected to Miami International Airport and landed around 11:55pm Sunday, where he was arrested and the flight was able to continue on to Chicago.

Reyes was taken into custody by the Miami-Dade Sheriff’s Office and turned over to the FBI for questioning, according to the documents.

LOOK: 15 formerly popular foods in America that are rarely eaten today

Stacker researched the history of popular foods, from Jell-O salads to Salisbury steak, and highlighted 15 that are no longer widely consumed.

Gallery Credit: Stacker

More From 97X