By Tim Fitzsimons and The Associated Press

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 March 29 incident, police said. Bergland was booked on charges of attempted murder, mayhem, aggravated assault, carrying a concealed dirk or dagger and brandishing a weapon, according to NBC Bay Area.

Leor Bergland was arrested in San Francisco after allegedly using a samurai sword to slash a man's hand. Multonomah County Oregon Sheriff's Dept.

Bergland and a 27-year-old resident of Berkeley, California, 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.

The victim was treated and released from a hospital, according to police, who did not release the victim's name.

Jail records do not indicate whether Bergland is represented by an attorney.

Scott Sweeney, a passerby, told the San Francisco Chronicle that he was in the same neighborhood where the attack took place about 30 minutes prior to 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 said he hadn't seen anyone like that.

Bergland, who according to public records appears to be homeless, has a history of arrests in Oregon. In October 2012, he was charged in Multnomah County with criminal mischief, unlawful entry into a motor vehicle, and theft.

So far in 2019, people donning Trump’s signature MAGA hats have been both the victims and perpetrators in a variety of violent incidents.

In January, an armed man wearing a MAGA hat attempted to enter a Houston-area Drag Queen Story Hour event, according to the Houston Chronicle. In February, a man wearing a MAGA hat at a Trump rally in Texas reportedly “violently pushed and shoved” a BBC cameraman. Trump supporters were targeted because of their hats in Kentucky, Oklahoma, Florida and Arizona.

FOLLOW NBC OUT ON TWITTER, FACEBOOK & INSTAGRAM