Jair Bolsonaro, a leading presidential candidate whose heated rhetoric has electrified some voters and angered others in a deeply polarized Brazil, was stabbed at a campaign event Thursday and suffered serious abdominal injuries.
Police said the suspected attacker was in custody.
Dr. Luiz Henrique Borsato, who performed emergency surgery, said Thursday night that the right-wing candidate was in serious but stable condition and would remain in intensive care for at least seven days. The first round of Brazil's presidential election is Oct. 7.
The doctor said the two-hour procedure stopped serious internal bleeding and repaired most of the damage from the knifing. The candidate will need further surgery within months for a part of his intestines that was temporarily fixed with a colostomy, the surgeon said.
"We can't say when he will be able to leave hospital," Borsato said. "But in the first hours after the surgery his recovery has been very satisfactory."
Numerous videos on social media showed Bolsonaro, who has promised to crack down on crime in Latin America's largest nation, being stabbed with a knife to the lower part of his stomach while campaigning in Juiz de Fora, a city about 125 miles (200 kilometers) north of Rio de Janeiro.
At the moment of the attack, Bolsonaro was on the shoulders of a supporter, looking out at the crowd and giving a thumbs up with his left hand.
After the attack, he is seen flinching and then goes out of view. Other videos show supporters carrying him to a car and hitting a man who was apparently the suspect.
Police spokesman Flavio Santiago confirmed to The Associated Press that 40-year-old Adelio Bispo de Oliveira had been arrested in connection with the incident.
De Oliveira was beaten badly by Bolsonaro supporters after the attack. The man was arrested in 2013 for another assault, police said.
Luis Boudens, president of the National Federation of Federal Police, told AP that the assailant appeared to be mentally disturbed.
"Our agents there said the attacker said he was 'on a mission from God,'" Boudens reported. "Their impression is that they were not dealing with a mentally stable person. He didn't expect to be arrested so quickly; agents reacted in seconds."
Bolsonaro's son, Flavio Bolsonaro, initially posted on Twitter that the injury was superficial and his father was fine. However, an hour later he posted another tweet saying the wound was "worse than we thought."
He arrived at the hospital "almost dead," Flavio wrote. "His condition now seems stabilized. Please pray."
A statement from federal police said the candidate had bodyguards. In the videos, Bolsonaro does not appear to be wearing a protective vest. Such measures are rare for candidates in Brazil.
"This episode is sad," President Michel Temer told reporters in Brasilia. "We won't have a rule of law if we have intolerance."
Bolsonaro, a former army captain, is second in the polls to jailed ex-President Luiz Inacio Lula da Silva, who has been barred from running but continues to appeal.
Despite being a congressman since 1991, Bolsonaro is running as an outsider ready to upend the establishment by cracking down on corruption in politics and reducing crime, in part by giving police a freer hand to shoot and kill while on duty.
While Bolsonaro has a strong following, he is also a deeply polarizing figure. He has been fined, and even faced charges, for derogatory statements toward women, blacks and gays.
He speaks nostalgically about the country's 1964-1985 military dictatorship and has promised to fill his government with current and former military leaders.
Earlier this week, Bolsonaro said during a campaign event that he would like to shoot corrupt members of the leftist Workers' Party, which made da Silva its candidate. The comment prompted an immediate rebuke from the attorney general, who asked Bolsonaro to explain that comment.
His vice presidential running mate, Hamilton Mourao, is a retired general who blamed leftists for the knife attack.
Underling Brazil's divisions, people took to Twitter to either to decry the stabbing and ask for prayers for Bolsonaro or to say the candidate had brought it upon himself and even may have staged it.
The top five trending topics in Brazil were related to the stabbing.
Other presidential candidates quickly denounced the stabbing and many of them decided to suspend their campaign events Friday.
"Politics is done through dialogue and by convincing, never with hate," tweeted Geraldo Alckmin, former governor of Sao Paulo who has focused negative ads on Bolsonaro.
Fernando Haddad, who is expected to take da Silva's place on the Workers' Party ticket, called the attack "absurd and regrettable."
The attack comes at a time of increasingly heated rhetoric, and sometimes violence, related to campaigns and candidates.
In March, while da Silva was on a campaign tour in southern Brazil before his imprisonment, gunshots hit buses in his caravan. No one was hurt, and da Silva, who is in jail on a corruption conviction, was not in the vehicles that were hit.
Also in March, Marielle Franco, a left-leaning black councilwoman in Rio de Janeiro, was shot to death along with her driver after attending an event on empowering black women.
It wasn't immediately clear how the attack on Bolsonaro might reshape a presidential race very much up in the air with the front-runner, da Silva, in jail. In many ways, the incident feeds Bolsonaro's narrative that Brazil is in chaos and needs a strong hand to steady it.
"It's likely that Bolsonaro will use the attack to argue his opponents are desperate, that they had no other way to stop him," said Mauricio Santoro, a political science professor at Rio de Janeiro's state university.
A handful of Bolsonaro supporters held a vigil in São Paulo on Thursday night, and briefly exchanged insults with leftists. 'They made Bolsonaro a martyr,' said Jonatan Valente, a student. 'I think the left shot itself in the foot because with this attack they will end up electing Bolsonaro.'"
Associated Press reporters Marcelo Silva de Sousa, Sarah DiLorenzo and Victor Caivano contributed to this report.