An armed man allegedly hijacked an MTA bus in Queens on Thursday morning, causing the driver to jump out of a window before the bus crashed into a utility pole, authorities said. KTLA’s sister station WPIX reports.

Police said the 44-year-old suspect ran in front of the bus with a gun before boarding the vehicle at around 7:23 a.m. While the bus was stopped, authorities said, the driver kept the front and back doors open so passengers could escape.

There were about 20-25 riders onboard. They were not injured.

While on the bus, the suspect said he was being chased and told the driver to keep driving. The driver panicked and jumped out of the window, police said.

The suspect then got behind the wheel but crashed into the utility pole, police said.

The driver, a 21-year veteran, and the suspect were taken to the hospital with minor injuries, officials said.

The suspect, who has a history of mental illness, was apprehended across the street from the crash and an imitation pistol was recovered at the scene, police said.

“We’re thankful there were no major issues,” an MTA official said.

Charges against the suspect are pending.

About 850 customers lost power after the incident, but most of the service was restored, according to Con Edison.