SAN FRANCISCO (CBS SF) — A suspect who allegedly brandished a knife at someone was safely taken into custody late Tuesday night after barricading themselves inside a building in the Tenderloin for more than 15 hours, according to San Francisco police.

San Francisco police said the suspect was taken into custody by members of the SFPD Tactical Unit who entered the premise on at approximately 9:24 p.m. The subject has been taken to a local hospital for medical treatment and evaluation. Release of the suspect’s identity and charges are pending further investigation.

It all started when a man armed with a knife got into a confrontation with police early Tuesday, and fled into a vacant office building after officers fired upon him, according to authorities.

San Francisco police spokesman Officer Robert Rueca said his agency received 911 calls around 6:36 a.m. of a man waving a knife in the 600 block of Jones St. Officers arrived on the scene and made contact with the man.

“Officers made contact with the suspect, during the contact the officers had an officer-involved shooting,” Rueca said. “A foot pursuit occurred shortly after that.”

The suspect outraced police for several blocks before ducking into a building on Ellis St., beginning the standoff.