Security guards stopped a knife-wielding man from approaching Finnish Prime Minister Jyrki Katainen while he was campaigning for municipal elections.
"The man was stopped before he reached the prime minister. He didn't have time to stab him," said a government spokesman. "Katainen will continue his duties as normal."
The incident happened in the city of Turku, where Mr Katainen was campaigning ahead of Sunday's municipal elections.
Police said the man, in his 30s, was in a crowd of people in the city centre when he "suddenly wielded a knife."
"The man did not behave aggressively or directly threaten the prime minister or others nearby," police said. "He was quickly apprehended by police and is being held in custody."
Robert Seger, a Finnish newspaper photographer who saw the incident, said the man dropped to his knees in front of Mr Katainen, holding a knife, but didn't attack him.
"He was trying to get Katainen's attention," he said.
Shortly before the incident, the man had shaken hands with Mr Katainen and introduced himself to the prime minister, Seger said.
"I didn't hear his name. But the man said he was in lots of trouble. Then he just dropped down on his knees and suddenly I saw a knife in his hand ... but he lowered it on the ground."
He said security guards quickly grabbed the man and pulled him away from Mr Katainen, who leads a coalition government after winning national elections last year.
The government's security chief Timo Harkonen said that the prime minister's security team had closely monitored the incident and "prevented it from becoming a dangerous situation."
Politicians in the Nordic countries often mingle with voters without stringent security measures, despite a couple of high-profile attacks against government officials and political parties in recent decades.
In Sweden, Prime Minister Olof Palme was gunned down on a Stockholm street in 1986 and Foreign Minister Anna Lindh was fatally stabbed in a shopping centre nine years ago. Both were without security guards.