Passengers and flight attendants had to subdue an unruly passenger who allegedly tried to open a plane's door and get into the cockpit on a flight from Los Angeles, California, to Washington, D.C., on Sunday afternoon. 

The flight was diverted to Kansas City shortly after 2:00 p.m.

"He was trying to but he couldn’t get to it," an airline official told passengers when asked about the man trying to get into the cockpit. "Then he tried to, he actually tried to open the plane door."

Mouaz Moustafa, a passenger on the plane, said everything was calm until a flight attendant suddenly yelled to a colleague to turn on all the lights and the plane started "descending very, very, very rapidly." 

"There was a man who was trying to get into the cockpit and trying to open the cockpit door, and he was trying to also open the plane door after he, I guess, failed at the cockpit door," Moustafa told Fox News Digital. 

FRONTIER FLIGHT DIVERTED TO RALEIGH AFTER UNRULY PASSENGER'S MELTDOWN CAUGHT ON VIDEO

"As people were trying to subdue him and everything, the same flight attendant runs all the way to the back and grabs like a coffee pot, goes all the way to the front and starts bashing this guy, like in the head," he said. 

American Airlines prepares to land in Las Vegas, Nevada.

An American Airlines flight taking off (iStock)

The FBI and other law enforcement agencies were awaiting the unruly passenger when the plane landed in Kansas City. 

"We’re grateful to our crew members, who are consistently dedicated to the safety and care of our customers and who handled the circumstances with the utmost skill and professionalism," an American Airlines spokesperson told Fox News Digital in a statement. 

All the other passengers had to deplane while the FBI completed a security check.

CLICK HERE TO GET THE FOX NEWS APP

The plane descended in just seven or eight minutes, Moustafa said. 

"Honestly, today, I thought that I was going to die," he said of the descent. 

The FBI did not respond to a request for comment on Sunday.