A man cursing and muttering incoherently opened fire aboard a packed Greyhound bus in Southern California early Monday, killing one person and wounding five others in a seemingly random attack before passengers disarmed him, authorities and a witness said.

The driver of the Los Angeles-to-San Francisco bus pulled off onto the shoulder, where some of those aboard led the killer off the vehicle, and he was quickly taken into custody, California Highway Patrol Sgt. Brian Pennings said. The driver continued on to the next exit as passengers performed first aid on the wounded, he said.

The motive for the shooting was not immediately known, and there was no indication the gunman knew any of the victims, Pennings said. He said several ammunition magazines were discovered along with the gun.

The bus was traveling on Interstate 5 near the small mountain community of Lebec, about 70 miles northwest of Los Angeles, when the passenger started shooting with a semi-automatic handgun shortly before 1:30 a.m. Forty-three people were aboard, including 6- and 8-year-old children, who were not hurt.

The dead passenger was identified as a 51-year-old woman from Colombia. Two victims were hospitalized with serious injuries, Pennings said. The remaining passengers were later driven to Northern California on another bus.

Passenger Mark Grabban, 29, told The Associated Press that the gunman had been sitting with his leg sticking out into the aisle, muttering to himself incoherently.

“He was just saying weird stuff like 'you don’t know me like that,' ‘wait til we get to the station,' 'get away from the dude in the striped shirt,’ ” Grabban said in a series of Instagram messages.

Suddenly, the man started cursing and shooting, Grabban said. Grabban hid beneath the seat in front of him. He said the gunman seemed to fire eight or nine shots that “seemed to go on forever.” He added: “I was waiting for one to hit me."

“I thought I was shot because I felt a rush of heat on the back of my head as I went down,” he said. “But I guess I just smashed my head on the seat as I went down to the floor.”

Then, silence fell. The injured passengers began moaning, and others started panicking. It was dark outside and they couldn't see what the gunman was doing after he got off the bus. Grabban said the driver of the stopped vehicle asked over the loudspeaker if anyone had been hurt and did not immediately pull away. “Everyone was screaming at him to drive off,” Grabban said.

Pennings said the driver's actions "were very appropriate and one could say heroic.” The officer gave no immediate details on how the passengers disarmed the killer or made him get off the bus.

Passengers told Grabban someone wrestled the gun away from the shooter, but he didn't witness it, he said.

No immediate charges were brought against the the suspect, whose name was not released.

Grabban, who was sitting near the back of the bus with his girlfriend, picked up the gun's empty magazine clip and handed it to the driver. A casing ended up on Grabban's lap, and he noticed a bullet hole in the floor next to him.

“I saw the blood on the floor of the aisle,” Grabban told NBC News. "I looked to the woman on the left, and she wasn’t responding, wasn’t moving or anything. She was lifeless."

Authorities were looking into whether a video camera aboard the vehicle captured the attack, which happened when the bus was at the top of Tejon Pass. It rises to an elevation of more than 4,100 feet in Lebec.

Greyhound prohibits passengers from bringing guns, explosives or dangerous chemicals on board its buses or in their luggage, according to its website. The company declined to answer additional questions about security on its buses.

The Associated Press contributed to this report.