BAKERSFIELD, Calif. (KGET) — A man allegedly throwing rocks at passing vehicles and destroying property from atop a Downtown Bakersfield rooftop was arrested after a four-hour standoff, police said.

KGET cameras show the man, identified as 44-year-old Raymond Valenzuela, was taken into custody as of 12:15 p.m. Wednesday.

The Bakersfield Police Department blocked off 24th street near Eye and 23rd streets after Valenzuela allegedly climbed on top of a business in the 2300 block of Eye Street with a machete-style knife, officials said.

It happened at the Mercy Plaza Pharmacy on Eye street, forcing several people to leave work.

“I came into work around 8:40,” said Jaime Sotelo, who was evacuated from work. “There was somebody on the roof throwing rocks.”

Police said a mental health team and negotiators were on scene during the incident to get Valenzuela to surrender.

According to police, Valenzuela made threats to officers and threatened to harm himself while also vandalizing the building. Workers inside the building were evacuated.

Valenzuela surrendered to officers at around 12:20 p.m. and was taken into custody. He was taken to a hospital for treatment and was later booked into the Kern County Jail on multiple charges including resisting arrest, vandalism, assault on an officer, and a parole violation.

Valenzuela is due in court on Friday, according to online inmate records.