The man arrested Wednesday night in connection with last Friday's kooky-scary sword attack outside the Church of 8 Wheels was a resident of a Tenderloin SRO, and it's still unclear what led police to him.

Suspect Leor Rapi Bergland, 30 — the infamous assailant who according to witnesses was wearing a MAGA hat and harassing roller-skate patrons before the attack — was arrested Wednesday at a Tenderloin restaurant. He's being held on $1 million bail on suspicion of attempted murder, mayhem, assault with a deadly weapon that's not a firearm, carrying a concealed dirk or dagger, and brandishing a weapon. According to jail records he was booked at 12:39 a.m. Thursday.

The SFPD says they had staked out the residence hotel where he'd been living, the Elk Hotel at Larkin and Eddy, and followed him to the restaurant. The Elk Hotel is an 87-unit supportive housing complex for formerly homeless, single individuals that is part of the Tenderloin Housing Clinic portfolio.

The Chronicle has now dug into Bergland's criminal past, via Oregon law enforcement records, and he does indeed have a rap sheet.

Bergland was charged in two incidents in one week in Multnomah County, Oregon in October 2012, from which we get the mugshot below.

Both incidents happened in and around Portland, and it sounds as though Bergland may have been homeless at the time.

In one incident, Bergland was found "hunched over" in a man's van, and when the man tried to remove him and a struggle ensued, Bergland allegedly waved a knife at him. A few days later he was nabbed trespassing on the campus of Portland State University. He was charged, as the Chronicle reports via court records, with misdemeanor criminal trespassing, unlawful entry into a vehicle, third-degree theft, and felony criminal mischief, but the charges were ultimately dropped.

We'll update you if the SFPD shares a mugshot of their own.

Previously: Sword-Attack Suspect Arrested; Victim Released From Hospital