San Francisco police are investigating a disturbing attack on an Asian man in the city’s Bayview district that was captured on video and posted on social media over the weekend, showing a group of men shouting racial slurs and mocking the victim, officials said Monday.

Investigators out of Bayview Station as well as the department’s Special Investigations Division were working to locate the victim and piece together what happened after the video hit social media on Sunday.

The video shows a man swinging a metal bar at the victim along Oceola Lane while apparently robbing him of his large collection of cans as onlookers record the attack on their phones.

“I hate Asians n—” one person is heard saying during the incident.

The victim appears to be crying as bystanders mock him and put their cell phones in his face.

Police were working to determine when the attack happened. The video was first posted on Instagram but later taken down. Others recorded the video and posted it to other social media sites like Twitter.

Supervisor Shamann Walton’s office, which represents the Bayview, denounced the attack on Monday.

“We absolutely do not tolerate any type of senseless violence and racism towards any of our community members especially towards our most vulnerable,” Walton’s chief of staff, Natalie Gee, wrote in the statement. “It is heartbreaking to see this type of violence occur in our community, and no one should ever have to endure this.”

Gee said neighbors recognized the victim as a longtime visitor who often collects cans from residents’ homes with his wife. The victim was apparently collecting cans when he was suddenly accosted, she said.

District Attorney Chesa Boudin on Monday said he had seen the video and was “very disturbed.”

The incident follows other recent high-profile attacks on seniors in the San Francisco’s Chinese-American community, including three people who were beaten in Chinatown, that prompted widespread outrage from city leaders.

Anyone with information was asked to call the Police Department’s 24-hour tip line at (415) 575-4444.

Evan Sernoffsky is a San Francisco Chronicle staff writer. Email: esernoffsky@sfchronicle.com Twitter: @EvanSernoffsky