(Recasts with comments from candidates, scene in Rio de Janeiro)
By Anthony Boadle and Jake Spring
BRASILIA, Oct 7 (Reuters) - A far-right lawmaker leading Brazil's presidential race forecast a first-round victory on Sunday as voters cast ballots in what has become a referendum on the former army captain who praises dictatorships and vows a brutal crackdown on crime and graft.
Front-runner Jair Bolsonaro has surged in opinion polls in the past week, all but guaranteeing a spot in the second round of voting and raising a narrow chance of a first-round victory.
Bolsonaro, 63, was accompanied by a nurse as he cast his vote on Sunday, a month after a near-fatal stabbing at a campaign rally that required two emergency surgeries. He said he was confident he had the majority of valid votes necessary to clinch the race without a runoff vote on Oct. 28, avoiding a showdown with the leftist Workers Party (PT).
"If God is willing, we'll settle this today," he told reporters. "We are on an upward trajectory and are confident that the Brazilian people want to distance themselves from socialism."
Bolsonaro is riding a wave of anger at the establishment over one of the world's largest political graft schemes and rising crime in the country with most murders in the world. His supporters blame all that on the PT, which ruled Brazil for 13 of the past 15 years, along with reckless economic policies that contributed to Brazil's worst recession in a generation.
Still, Brazil is split over the danger to democracy posed by Bolsonaro, a long-time congressman who advocates for torture and police violence, praises the country's 1964-85 military regime and suggested that opponents could only win the race through fraud, although he now vows to respect the electoral process.
Geneis Correa, 46, a business manager in Brasilia, said she voted for Bolsonaro and would support a coup if the PT wins, blaming the party for rampant corruption.
"If they win, it will become Venezuela. People will be hungry, with a currency that is worth nothing," she said, while leaving a polling station with her daughter. "If the PT is voted into power and there is a military intervention, I would support it."
Bolsonaro's closest rival, PT candidate Fernando Haddad, a former education minister and one-term mayor of Sao Paulo, is standing in for the party's jailed founder, former president Luiz Inacio Lula da Silva, who is serving time for bribery and money laundering.
Many Brazilians, such as Ruth Pereira Santos, 65, fondly remember the years of rapid growth that Lula oversaw and benefited from his programs lifting millions out of poverty.
"Who could buy a car? For the love of God today I have a car in my garage. This wasn't accessible before," said Santos, a caretaker for the elderly.
Two polls published late on Saturday showed Bolsonaro had increased his lead over Haddad in the past two days, taking 36 percent of voter intentions compared with Haddad's 22 percent. The pair are deadlocked in a likely runoff.
Polling stations opened at 8 a.m. (1100 GMT) and the last will close at 7 p.m. Brasilia time (2200 GMT). Exit polls and official results will start flowing in soon after that via Brazil's electronic voting system.
Voting was progressing without major incident as of early afternoon. Many Brazilians faced long wait times to vote and a line of more than 500 people snaked outside one polling station in Rio de Janeiro's Copacabana neighborhood.
Brazil's 147 million voters will choose the president, all 513 members of the lower house of Congress, two-thirds of the 81-member Senate, plus governors and lawmakers in all 27 states.
Almost two-thirds of the electorate are concentrated in the more populous south and southeast of Brazil where its biggest cities, Sao Paulo and Rio Janeiro, are located - and where Bolsonaro holds a commanding lead. A quarter of voters live in the less developed northeast, traditionally a PT stronghold.
In the most polarized election since the end of military rule in 1985, Bolsonaro is backed by a group of retired generals who have criticized the 2003-2016 PT governments and publicly advocate military intervention if corruption continues.
It is not clear how much campaigning the congressman will be able to do if the vote heads into a runoff. He has said he is about 70 percent recovered.
Bolsonaro, who compares his campaign to U.S. President Donald Trump's 2016 run, dismissed as "fake news" the accusations of sexism, racism and homophobia that he has stirred up with a record of offensive comments.
A Bolsonaro government would speed the privatization of state companies to reduce Brazil's budget deficit and relax environmental controls for farming and mining. It also would block efforts to legalize abortion, drugs and gay marriage.
Bolsonaro on Sunday claimed he had the support of 350 congressman thanks to wide backing by the agriculture voting bloc as well as many evangelicals.
Haddad, who has presented himself as a fiscally responsible moderate, criticized Bolsonaro for skipping televised debates and accused him of wanting to win in the first round to avoid further democratic discussion.
After casting his vote on Sunday, Haddad said he was confident the race would go to a second round and raised the prospect of forming a broader pro-democracy alliance.
"I have the utmost respect for those who have run in the first round," Haddad said, naming several candidates he has worked with before.
"We will look to expand the parties in our alliance. This moment demands that we extend our hand to Brazilians, regardless of parties, who want to contribute to the democratic rebuilding of the country."
(Reporting by Anthony Boadle and Jake Spring in Brasilia Additional reporting by Rodrigo Viga Gaier and Gabriel Stargardter in Rio de Janeiro, Isabel Marchenta and Eduardo Simões in São Paulo Editing by Nick Zieminski and Bill Trott)
Our Standards: The Thomson Reuters Trust Principles.