A high-speed chase through the Cape Flats ended in a gunfight after a car rammed pursuing traffic co.
The TAM Airlines jet was en route from Montevideo, Uruguay, to Sao Paulo on Saturday when a man who some passengers said was wearing a TAM identification badge got into the cockpit because the door was open.
Shortly after, the plane dove to the right, causing passengers to scream and the pilot to yell for help over the speaker system.
"All of a sudden shouts were heard from inside the cabin, and two stewardesses came out asking for help and grabbing a young man by his feet," said one passenger.
"The people quickly jumped on top of him, the guy fought back furiously, biting and hurting a half dozen people."
The suspect was eventually tied up with plastic handcuffs, taken to the rear of the plane and pinned into a back seat.
Uruguay's industry minister, Roberto Kreimerman, was on board the flight, leading a trade delegation that was on its way to China.
He said that when the plane veered sharply, passengers started screaming and fearing for their lives.
The jet safely landed at an airport in southern Brazil about 20 minutes after the incident, a police spokesman said Sunday. The suspect was arrested and taken to a mental care facility.
TAM said Flight 8047 "landed at the Porto Alegre airport because of an uproar on board."
"It seemed as if we were in a movie about the 9/11 attacks," passenger Matias Velazco, a former journalist for El Observador, told the newspaper.
He said it took about 10 minutes to subdue the man.
"Four of them tried to hold him down and they couldn't. One tried to give him an injection to sedate him, another hit him and still they couldn't control him," Velazco said.
Federal police inspector Luiz Daiello said the suspect had "suffered a psychotic attack". The man calmed down as the plane was landing.
But he said once police tried to take the man into custody, he became violent, and had to be subdued with a stun gun before being taken to a nearby hospital.