Police shot a man after he crashed a truck into a downtown courthouse early Saturday, ending a pursuit that began when he allegedly set fire to several squad cars in a nearby town and shot at an officer who chased him.

The man drove the pickup through the glass double doors of the Marion County Courthouse and hid inside the building for about three hours, setting at least one fire before police tracked him down in a stairwell, police Capt. Jeff Kuhns said.

He was in surgery Saturday afternoon, officials said. His condition and the extent of his injuries were not immediately released.

Authorities weren't releasing the man's identity but had "a few indications of what might have motivated him," Marion County District Attorney Walt Beglau said. He declined to elaborate.

"If it is who we believe, he doesn't have a very extensive criminal history," said Kevin Rau, spokesman for the Marion County Sheriff's Department.

The pursuit started shortly before dawn when the man allegedly poured a liquid on cars parked at the police department in the adjacent town of Keizer and set them on fire, authorities said.

An officer spotted him and chased him in her car, but the suspect fired at her, police said. The officer crashed but wasn't injured.

Shortly afterward, police got calls that someone in the area was firing shots at homes. Then, around 6:30 a.m., Salem Police got a call that someone had driven up the concrete steps of the courthouse and crashed through the doors.

Officers from several police departments surrounded the building and attempted to negotiate with the man until they confronted him in the stairwell and shot him.

A bomb squad was called in as a precaution and police searched the five-story courthouse for possible explosives but did not immediately find any.