SAN FRANCISCO (AP) — Officers arrested a man who slashed another man with a sword after the victim allegedly knocked his "Make America Great Again" hat from his head, San Francisco police said Thursday.

Leor Bergland, 30, of San Francisco was arrested in a restaurant Wednesday night by officers staking out his neighborhood since the Friday night incident, police said.

A 27-year-old Berkeley, California, resident and Bergland encountered each other outside of the popular Church of 8 Wheels, a roller-skating rink inside an old church in San Francisco's Fillmore district, police said.

Bergland drew a sword and slashed the victim's hand after the victim knocked Bergland's hat bearing President Donald Trump's campaign slogan to the ground, police said.

The victim and another man briefly pursued Bergland but stopped after Bergland turned on them and brandished the sword, police said.

Police didn't release the victim's name. The victim was treated and released from a hospital, police said.

Jail records don't indicate if Bergland is represented by an attorney.

Scott Sweeney told the San Francisco Chronicle that he was in the same neighborhood about 30 minutes before the incident and saw a man with a MAGA hat and a sword tucked into the back of his jacket.

The man, Sweeney said, was shouting homophobic slurs at him. "In my mind I didn't think it was a real sword until we came out later and police were on the scene and there was blood and the hat on ground," he said.

David Miles, who runs the roller rink at the former Sacred Heart Catholic Church, said he didn't see the attack but ran out to help the victim.

Miles said officers asked him if a man dressed as a pirate had come into the roller rink, but he hadn't seen anyone like that.