A witness recorded video of the armed man waving his weapon as speeding cars along Oakland's International Boulevard and inadvertently caught both times he was hit.
Police arrested the man after his 3 a.m. rampage, CBS San Francisco reported. While video of the attack was posted to YouTube Monday, it's not clear on what day the footage was recorded.
The man screamed and swung his machete at several cars, staggering into the street and back onto the sidewalk, video showed. One vehicle charged at the suspect as the knifeman narrowly dodged the car.
Later — after the witness recording the footage had called 911 — a red sedan is seen backing into the man, hitting him. As he walked away from the crash, a speeding white car plowed into the attacker again.
The second car sent the knifeman flying off its hood and tumbling into the intersection. As the sedan drove away, the man got up and walked away, his machete still in hand.
Police arrived at the scene after both hit-and-runs. Officers have not identified the suspect, detailed any charges against him or released information on the two drivers.
It's not clear if the man suffered serious injury from either crash.