A drive-by shooting wounded a federal security officer outside the U.S. courthouse in downtown Phoenix on Tuesday, and a person was later taken into custody, authorities said.

The officer was taken to a hospital and was expected to recover, according to city police and the FBI. Jill McCabe, a spokeswoman for the FBI’s Phoenix office, said someone was later detained and there was no indication of a further threat to the public.

SUSPECT IN PORTLAND FATAL SHOOTING KILLED AS FEDERAL TASK FORCE MOVED IN

The court security officer works for the U.S. Marshals Service and was struck in their protective vest, said a law enforcement official who spoke on condition of anonymity because they were not authorized to discuss the investigation publicly.

Court security officers work under the direction of the U.S. Marshals Service but generally are employed by private security companies.

The FBI said it isn’t providing any more details as it investigates the shooting. Police had released a photo of a silver sedan spotted leaving the area around the Sandra Day O’Connor U.S. Courthouse.

ARIZONA TEENS ARRESTED NEAR MEXICO BORDER WITH $2M WORTH OF HARD NARCOTICS IN PICKUP TRUCK

Hours after the shooting, a street surrounding the courthouse was closed to traffic, roped off by yellow tape with police officers standing on each corner. Armed federal officers talked outside the main entrance to the courthouse, which was still open to the public, according to a court clerk.

The shooting came after the weekend ambush of two Los Angeles County deputies. They were sitting in their parked vehicle when a man walked up to the passenger’s side and fired multiple rounds.

The deputies were struck in the head and critically wounded but were expected to recover. The gunman hasn’t been captured, and a motive has not been determined.

Federal courthouses have been flashpoints for recent violence, but it’s not clear who shot the officer in Phoenix or why.

In June, a federal security officer was shot and killed and his partner was wounded outside the federal courthouse in Oakland as they guarded the building during protests over racial injustice and police brutality. An Air Force sergeant was charged with the shooting, and prosecutors say he had ties to the far-right, anti-government “boogaloo” movement and used the protest as cover for the crime and his escape.

During demonstrations in Portland, Oregon, protesters and federal officers clashed at the federal courthouse, where people set fires and tossed fireworks and rocks, while federal authorities unleashed tear gas and made arrests.