A Maryland man has been arrested in connection to Monday’s deadly random shooting on a Greyhound bus in Southern California, police said.

Anthony Devonte Williams, 33, from Capitol Heights, just outside D.C., was accused of opening fire as the bus was traveling from Los Angeles to San Francisco overnight Monday, killing one passenger and wounding five others, according to police.

Passengers wrestled the gun away from Williams and chased him off the bus after it came to a stop on Interstate 5 near Lebec, 70 miles north of LA, according to reports.

CALIFORNIA GREYHOUND BUS SHOOTING LEAVES 6 INJURED, SUSPECT IN CUSTODY

“Due to some very heroic acts by the passengers, they were able to overcome this subject and disarm him,” California Highway Patrol Sgt. Brian Pennings said. “They were able to escort him off of the bus.”

Mark Grabban, 29, who was on the bus with his girlfriend, said he heard the gunman muttering to himself incoherently and cursing before he opened fire, the Associated Press reported.

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

Grabban said he heard eight or nine shots as he hid beneath the seat in front of him.

He said he smashed his head as he got down to hide, making him think for a moment that he had been shot.

NEW HAMPSHIRE WEDDING SHOOTING LEAVES 2 WOUNDED, THIRD PERSON HURT SUBDUING ALLEGED GUNMAN

Police said the passenger who was killed was a 51-year-old woman from Columbia, KABC-TV reported.

A 45-year-old man and a 19-year-old woman were critically wounded, the station reported. The other injured victims were a 39-year-old female, a 49-year-old man and a 50-year-old.

Pennings said there’s no indication Williams knew any of the victims.

He is now facing murder and attempted murder charges after being jailed in Kern County.

CLICK HERE TO GET THE FOX NEWS APP

Online records show that in March 2016 Williams pleaded guilty in D.C. to possessing an unregistered firearm. The charge stemmed from an arrest seven months earlier. He was ordered to serve a suspended 10-day jail sentence.

The Associated Press contributed to this report.