(Updates to reflect beginning of candidacy, includes Bolsonaro speech)
By Gabriel Stargardter and Gram Slattery
RIO DE JANEIRO, July 24 (Reuters) - Brazilian President Jair Bolsonaro kicked off his candidacy for re-election at a party event in Rio de Janeiro on Sunday with a speech focused on God, guns and family, as the right-wing leader attempts to claw back the commanding lead established by his main rival, former President Luiz Inacio Lula da Silva.
The right-wing Liberal Party (PL) tapped Bolsonaro as its nominee for the Oct. 2 vote before an audience of several thousand in Rio's Maracanazinho stadium, a move considered the official beginning of Bolsonaro's candidacy under Brazilian law.
The nomination comes as the president continues to launch baseless attacks on the reliability of the nation's electronic voting system, casting doubt on whether he would accept defeat. While the president did not touch directly on those matters on Sunday - focusing instead on socially conservative stances popular with his base - his speech was heavy with praise for the armed forces who he said shared his concerns.
"The army is on our side," he told cheering supporters. "It's an army that doesn't accept corruption, doesn't accept fraud. This is an army that wants transparency."
With his image battered by inflation, Bolsonaro is down almost 20 percentage points in some polls to Lula, who governed the nation from 2003 through 2010 and lifted millions out of poverty thanks to aggressive social spending during a period of rapid commodity-driven growth.
Lula's star has fallen in recent years due to high-level corruption probes - he spent over a year and a half in jail due to a graft conviction that was later overturned - but he remains a relatively popular figure among Brazilians.
For Bolsonaro fans here, however, waving Brazilian flags and bedecked in the national soccer jersey, the possibility of a Lula comeback is unconscionable.
The biggest jeers came when Bolsonaro mentioned Brazil's Supreme Court, whose members have gone to battle with Bolsonaro allies over unfounded election fraud claims.
Vera Carvalho, 59, a Rio schoolteacher, said she hoped there would not be a coup, but if there were, it would be the fault of the left for attempting to install a corrupt president.
"I hope there isn't one, but I fear that there could be," she said. "Lula needs to go back to jail. He is vermin."
The leftist Workers' Party (PT) officially nominated Lula on Thursday, while left-of-center candidate Ciro Gomes, running in a distant third, was nominated by the Democratic Labor Party (PDT) on Wednesday.
In the coming weeks, the already tense battle between the top two candidates should heat up even further. In mid-August, Lula and Bolsonaro will be freed up by authorities to engage in most forms of political advertising.
(Reporting by Gabriel Stargardter; Additional reporting by Ricardo Brito in Brasilia; Writing by Gram Slattery Editing by Marguerita Choy and Lisa Shumaker)