A 54-year-old man was charged Friday with three counts of attempted murder, three counts of assault against a law enforcement officer, and a host of related offenses for allegedly shooting at three Philadelphia Police officers outside a SEPTA bus Thursday, striking and wounding one.

Walter Farrell was arraigned Friday morning and held without bail for his role in the shootout at Torresdale Avenue and Howell Street in Wissinoming, according to court records.

Farrell is accused of firing at Officer Donald Revill, 37, of the 15th District, and two other officers who had responded to a report of a man with a gun on Comly Street about 10 a.m.

Police said two officers saw a man who fit the description board the Route 56 bus, so they stopped the bus and boarded it. Farrell pointed a gun at the officers, who then got off, police said.

Farrell followed the officers onto the street and began firing, police said. The two officers — whom police did not identify — shot back, police said, and Revill arrived and got into a tussle with Farrell. During the scuffle, Farrell allegedly fired a shot that grazed Revill’s arm.

Farrell was shot multiple times throughout his body, police said, and was initially taken to Temple University Hospital in critical condition.

According to court records, Farrell in 2006 pleaded guilty to criminal trespass and stalking and was sentenced to nine to 23 months in prison.

None of the passengers on the bus Thursday was injured, police said.

The Philadelphia District Attorney’s Office said the events leading up to the shooting remain under investigation.