He is undergoing surgery, according to a statement from the local hospital where he was admitted.
The 63-year-old lawmaker has "a wound in the abdomen that has been caused by a sharp instrument", said the Santa Casa hospital in the southeastern city of Juiz de Fora, describing his condition as "stable".
President Michel Temer quickly condemned the attack and instructed his minister of security to reinforce security for election candidates.
But Flavio Bolsonaro, the candidate's son, said early Friday outside the hospital where his father was treated that he was conscious and the attack was a political boost.
The only Brazilian politician now more popular is the leftist ex-president Luiz Inacio Lula da Silva, who is in prison for corruption and has been banned from competing in October's election.
Bolsonaro has climbed steadily in the polls on the back of political corruption, rising crime rates across Brazil's urban areas and a well orchestrated social media campaign.
Meanwhile, on Twitter many decried the stabbing and asked for prayers for Bolsonaro, but others suggested the candidate might have brought the attack upon himself or even staged it.
Trump poised to tax an additional $200B in Chinese imports
It also said that every Apple product "contains parts or materials from the United States and is made with equipment from US-based suppliers".
Bolsonaro, like Lula da Silva, is revered by some but despised by others, reflecting the stark political polarization now gripping the South American nation. That message has resonated with Brazilians, but his often derogatory comments about women, blacks and gays have also repulsed many.
Videos from the event show that Bolsonaro was sitting on someone's shoulders when an unidentified person stabbed him in the stomach.
Local police in Juiz de Fora, where the attack took place, told Reuters the suspect, Adelio Bispo de Oliveira, 40, was in custody and appeared to be mentally disturbed.
This is not the first time in recent months that violence has touched politicians.
Bolsonaro's son, Eduardo, also a congressman, said his father had lost two liters (4.23 pints) of blood from the ordeal. In March, while da Silva was campaigning in southern Brazil before his imprisonment, gunshots hit buses in his caravan, although no one was hurt.
A handful of Bolsonaro supporters held a vigil in São Paulo on Thursday night, and briefly exchanged insults with leftists. "'I think the left shot itself in the foot because with this attack they will end up electing Bolsonaro'".
The former military officer is considered a far-right populist and is now leading the polls. His vice presidential running mate is a retired general.