The leading candidate in Brazil's presidential election, Jair Bolsonaro, was stabbed and seriously injured while campaigning, with police saying the suspect claimed to be acting on orders from God.
The attack was the latest bizarre twist in a presidential race in which the most popular candidate, former president and leftist hero Luiz Inacio Lula da Silva, is trying to run from prison. The Supreme Court disqualified Lula on Thursday. First round voting is scheduled for October 7.
Bolsonaro underwent surgery for wounds his mid-section and was listed in serious but stable condition after the attack in the south-eastern city of Juiz de Fora.
Images shared on social media and Brazilian television showed Mr Bolsonaro being carried on the shoulders of supporters when a man lunges at his stomach.
A witness told police the attacker held a knife wrapped up in a shirt.
Police arrested the attacker immediately He was identified as Adelio Bispo de Oliveira, 40, and said to be a member of the left-leaning PSOL party from 2007 to 20014.
After his arrest, Mr Bispo de Oliveira said he was "carrying out a divine mission, a mission from God", said Luis Boundens, head of a union of federal police officers.
Authorities are investigating the suspect's mental health, he said.
Mr Bolsonaro, a member of congress and a former army captain, has been criticised for outbursts deemed racist, mysogynist and homophobic.
A lawyer for Mr Bispo de Oliveira said his client acted "for religious reasons, for political reasons, and also because of the prejudice Bolsonaro has always shown when he talks about race, religion and even women".
On his Facebook page, the attacker recently posted messages criticising Mr Bolsonaro and supporting the socialist government of President Nicolas Maduro in Venezuela.
Earlier, one of the candidate's sons, Flavio Bolsonaro, had announced on Twitter that his father's wounds were "superficial", but he later wrote: "Unfortunately, it's more serious than we thought."
President Michel Temer quickly condemned the attack and instructed his Minister of Security Raul Jungmann to reinforce security for candidates and conduct "a rigorous investigation," a spokesman for the presidency said.
"It is intolerable to see that in a democratic state it is not possible to have a normal campaign," said Mr Temer.
With Lula da Silva ruled out of the election, the latest polls from the Ibope Institute put Mr Bolsonaro in a clear lead with 22 per cent compared with 12 per cent each for environmentalist Marina Silva and center-left runner Ciro Gomes.
One of his campaign pledges has been to legalise the carrying of weapons in order to combat rising violent crime.
Despite being a long-serving member of congress, Mr Bolsonaro has successfully presented himself as an outsider, untouched by the corruption scandals engulfing so much of the political elite.
Perhaps the message that carries furthest is Mr Bolsonaro's push for a harder crackdown on crime - in a country where police are already often engaged in low-level wars against gangs. About 64,000 people die in homicides every year.
Yet he has also courted deep controversy with comments attacking women and sexual minorities, as well as for praising the country's 1964-1985 military dictatorship.
Sometimes described as Brazil's Donald Trump, Bolsonaro has a huge social media following of 8.5 million people.
Read more on South American politics: