At least eight people were injured, one seriously, when a vehicle ploughed into crowds celebrating New Year's Day in Tokyo early on Tuesday.
A police spokesman said the driver had been detained and national broadcaster NHK said the man had been arrested on suspicion of attempted murder.
He was identified as Kazuhiro Kusakabe, 21, from Osaka, a major city about 400 km (250 miles) southwest of Tokyo, NHK said.
NHK said the suspect had initially described the incident as an "act of terror" but later said the attack was in retaliation for capital punishment.
The incident happened shortly after midnight local time on Monday in the popular tourist area of Harajuku, near Meiji Shrine, in central Tokyo.
"I can't believe it, this is a place I'm familiar with, so it's very shocking," said Tatsuhiro Yaegashi, a 27-year-old worker in the area.
The street was closed to vehicles at the time of the incident to accommodate the large number of pedestrians making their way to the shrine for New Year's prayers.
TV pictures of the scene on Tuesday showed a grey colored light vehicle used in the attack, positioned across the street.
The front of the vehicle was badly damaged and dozens of police and rescue officials were at the scene.
The suspect fled from the scene and assaulted a passerby before he was captured 20 minutes later, NHK said. About 20 liters of kerosene were found in the vehicle.
"I learned about the incident later. But I shudder to think. If the incident had happened five minutes later, I would've been involved," a woman who walked past the scene shortly after the incident told NHK.
In a similar attack in 2008, a man who said he was tired of life drove a rental truck into a crowd of pedestrians in Tokyo before jumping out and stabbing several people. At least seven people were killed and a dozen injured.