The passengers sat stunned as they watched a man walk quickly towards the front of American Airlines Flight 1561 as it was descending toward San Francisco. He was screaming and then began pounding on the cockpit door.
"I kept saying to myself 'What's he doing? Does he have a bomb? Is he armed?"' said passenger Angelina Marty.
Another shocked passenger, Andrew Wai, thought: "Could this be it? Are we going down?"
Within moments, a flight attendant had tackled Rageh Almurisi. Authorities have not yet found a motive for his behaviour.
While the 28-year-old, of Vallejo, California, has no clear or known ties to terrorism, the incident underscored fears that extremists may try to mount attacks in retaliation for the killing of al-Qa'ida leader Osama bin Laden in Pakistan last week.
Federal agents are investigating Almurisi's background. He was carrying a Yemeni passport and a California identification card, authorities said.
Yemen, a nation at the southern tip of the Arabian peninsula, has been a focus of US officials because one of the most active branches of al-Qa'ida operates in a remote part of the country.
A cousin of the suspect described him as an educated, easygoing person who had arrived in Northern California from Yemen about 18 months ago in search of better opportunities.
He was unable to find work in Vallejo, a town of 100,000 across the bay from San Francisco, and recently moved to New York, where his brother lived, in search of better luck, said Rageh Almoraissi, 29, of Vallejo.
Almurisi had not told his extended family in California that he was returning to the area, his cousin added.
"He's very laid back, he's always smiling, he's always laughing. He's not an angry person," he said. "Everybody's worried about him. It's not typical of him."
Mr Almoraissi said he could not imagine what may have caused his cousin to act as authorities allege he did on the plane, but said he was certain he was not a terrorist. He said his cousin did not show an interest in politics and was not intensely religious.
"He might have seriously mistaken the cockpit for the bathroom," Mr Almoraissi said. "He's only been on three planes in his whole life.
Almurisi was taking classes in California to learn English but was not happy with his progress, his cousin said.
Almurisi went toward the cockpit door 30 minutes before the flight from Chicago was supposed to land on Sunday night, San Francisco Airport Police Sergeant Michael Rodriguez said.
Almurisi was yelling unintelligibly as he brushed past a flight attendant.
Ms Marty, 35, recalled that she and other passengers on the plane were stunned when they saw Almurisi walking down the aisle. She said a woman in a row across from her who speaks Arabic translated that Almurisi said "God is great!" in Arabic.
Mr Wai, 27, also remembered that the wife of one of the men who took Almurisi down later said he was yelling "Allahu Akbar".
"There was no question in everybody's mind that he was going to do something," Ms Marty said.
A male flight attendant tackled Almurisi, and other crew members and passengers, including a retired Secret Service agent and a retired San Mateo police officer, helped subdue him as he banged on the door, police said.
His arms were placed in plastic handcuffs. A pilot said over the loudspeaker that everything was going to be OK to cheers and applause.
"Everybody was fixated on him," Ms Marty said about Almurisi. "You never think that something like that would happen in your life."
Mr Wai said Almurisi appeared "fidgety" in his seat when he saw him on the way to the toilet earlier in the flight.
The Boeing 737 carrying about 162 people landed safely. Almurisi was placed into police custody and flight attendants were trying to soothe shaken and crying passengers.
"We were all looking at our lives flash before our eyes," said Mr Wai, a fourth-year medical student who flew in to visit his sister.
After leaving the plane, Mr Wai took pictures of Almurisi lying face down on the airport terminal floor with at least eight officers surrounding him and about another half a dozen nearby.
Almurisi was later put on to a stretcher.
Federal authorities took Almurisi into custody on yesterday morning after he spent the night at the San Mateo County jail, said San Mateo County Chief Deputy District Attorney Karen Guidotti.
He was being held on suspicion of interfering with a flight crew, authorities said
No-one else was hurt and the airport continued operating normally with security levels unchanged, Sgt Rodriguez said.
There were two other mid-air disturbances elsewhere on Sunday.
A 34-year-old man from Illinois tried to open a plane door on a Continental Airlines flight from Houston to Chicago. Investigators questioned him, but did not file charges.
And there was a security scare on board a Delta Air Lines flight from Detroit to San Diego, prompting it to land in Albuquerque, New Mexico. Authorities did not release any more details, except to say that "no suspicious devices" were found. No-one was arrested.