The man tied to a sword attack outside a popular San Francisco roller skating rink while dressed as a pirate and wearing a "Make America Great Again" hat has been arrested, police said.

San Francisco-resident Leor Bergland was taken into police custody Wednesday night. Bergland, 30, was booked into San Francisco County Jail on charges of attempted murder, mayhem, aggravated assault, carrying a concealed dirk or dagger and brandishing a weapon, according to police.

The attack was reported Friday night, when Bergland allegedly took out a sword and struck a person on the hand near the Church of 8 Wheels roller rink, officials said.

Police said the victim swatted the MAGA hat from Bergland's head. Bergland then used a sword and cut the victim's hand before running from the scene.

The victim was taken to a hospital with non-life threatening injuries.