This browser does not support the Video element.
SAN FRANCISCO - Surveillance video captured Friday night shows a man attacking an Asian San Francisco police officer after she tried to detain him near Portsmouth Square.
The incident happened just before 7 p.m. near Clay and Kearny Streets and video of the attack was posted to Instagram Sunday morning.
Witnesses told KTVU that the man seen on the surveillance video had been seen vandalizing rental scooters less than two hours earlier.
They also reported seeing the man yelling and threatening people.
One witness said at one point, the man said "Chinese people don't belong here."
SEE ALSO: The untold story of a Chinese cemetery in San Francisco
Police told the man he needed to leave, and the video shows that at first, he was compliant.
But then, he suddenly becomes violent and is seen pushing the officer and grabbing her mask and uniform.
She fights back.
Both land on the ground; he on top of her.
The officer can be heard telling dispatch that the man is resisting arrest and he is seen shoving her face to the ground.
A bystander comes by and tries to get the man off of her, and more people step in to help.
The officer ultimately pins him down to the ground and officers place the man into custody.
Her colleagues help the female officer to her feet. It's unclear what injuries she suffered, or what charges the man might face.
Ken Fong saw part of the attack.
"Even though he dropped her to the floor I'm happy she wasn't hurt majorly or injured because it could have been a lot worse," he said.
Fong also said he saw the homeless man two hours before in Portsmouth Square, where officers told him to leave because teens reported that he was damaging scooters.
"There were two teenagers that came up to them and said 'Hey, I don't feel safe because there's a suspicious guy hanging around our scooters," Fong recounted.
It appeared to Fong that the man had been drinking.
Community activist Max Leong said that many people in town know this man.
"He's been kind of a fixture here in San Francisco Chinatown," Leong said, adding that it also appears he has mental health issues. "It speaks to the fact more services need to be provided for the mentally ill."
Police told the man that he needed to leave, but he showed up again and began yelling racist comments at Asian people as they walked by.
When police responded again, the man attacked the female officer.
Bystanders helped the officer, and the man was taken into custody.
SEE ALSO: Asian designers creating t-shirts with anti-hate message
Police have not identified the man, but witnesses tell KTVU that the man appeared to be homeless.
It's unclear how severely the officer was injured in the attack.