SAN FRANCISCO (CBS SF) — A man wearing a “Make America Great Again” hat who allegedly slashed another man with a sword after an argument last Friday in San Francisco has been taken into custody, according to authorities.

Police in San Francisco had been investigating the attack since it happened on the evening of Friday, March 29. Shortly before 10 p.m. near the intersection of Fillmore Street and Oak Street outside of the Church of 8 Wheels — a former church converted into a roller skate disco — the victim said that the male suspect wearing the MAGA was walking towards him.

READ MORE: Dozens of Dogs, Cats Removed From Danville Home

When the victim swatted the hat off the suspect’s head, the suspect drew a sword and slashed the victim’s left hand and fled the scene. The victim and a witness pursued the suspect until the man with the sword turned and advanced towards them, when the victim and witness stopped their pursuit.

The suspect ran off while the victim, a 27-year-old male from Berkeley, returned to the scene and received treatment for his injury from paramedics and was transported to the hospital. He was later released.

One witness and his girlfriend said they had been confronted by the same man in the MAGA hat making homophobic slurs.

READ MORE: Oakland Church Group Hosts Party to Preach Anti-Violence by Practicing Community

“He was acting really nervous and strange and was kind of like walking around in circles and staring at us,” Sweeney said. “So we were weirded out.”

Police investigated the incident, gathering clues in an attempt to identify the suspect. Once officers determined his identity, police started around the clock surveillance in the area around the suspect’s home in their effort to locate him.

On Wednesday night at about  9:18 p.m., plainclothes police officers conducting surveillance in the area of Eddy Street and Larkin Street spotted the suspect inside a restaurant. The officers then took the suspect, identified as 30-year-old San Francisco resident Leor Bergland, into custody without incident.

Bergland was later booked into the San Francisco County Jail on the charges of attempted murder, mayhem, aggravated assault, carrying a concealed dirk or dagger and brandishing a weapon.

MORE NEWS: 18-Year-Old Man Shot Dead, Another Wounded Saturday in Bay Point

Due to pending identification issues, police said the suspect’s booking photo is not being released at this time.