Polls have closed in the Brazilian presidential election, in which incumbent Luiz Inacio Lula da Silva seeking a second term.
Lula is popular with poorer voters because of his welfare programmes
But it is not clear whether Lula has secured the 50% of votes needed to win outright victory in the first round.
His lead in opinion polls narrowed ahead of the vote amid allegations of dirty tricks by his Workers' Party.
His main rival is Geraldo Alckmin, the centre-left, business-friendly former governor of Sao Paulo state.
Counting is now under way of an estimated 125 million votes. Initial exit polls suggested Lula was in the lead with about 50% of the vote.
The votes were recorded using electronic ballot boxes, so most results should be known within hours.
Since Lula, the first left-winger to hold the country's highest office in 50 years, was elected in a landslide victory in 2002, his welfare programmes have helped him gain strong support among the country's poor.
But his once-commanding lead in the polls has been dented by a series of corruption scandals involving his Workers' Party.
Polls open: 0800 (1100 GMT)
Polls close: 1900 (2200 GMT)
Eligible voters: 125 million
Elections taking place: Congressional, regional, presidential
Final pre-election opinion polls showed Lula dipping a little below the 50% of the vote required to avoid a second-round run-off, while Mr Alckmin's scores had risen a few percentage points to about 35%.
"This is a glorious moment for Brazil because the election consolidates the democratic process," Lula said as he cast his vote. "I am sure we will win the election today, in the first round."
His opponent, meanwhile, voting in Sao Paulo, said opinion polls showed there would be a second round.
"They show our candidacy is up and the president is on a downward slide," said Mr Alckmin - who is standing for the Brazilian Social Democracy Party (PSDB).
Two weeks ago two men with links to the Workers' Party were arrested carrying $800,000 dollars in cash, which detectives believe was to have paid for a dossier of corruption allegations against the president's rivals.
The scandal led Lula to sack his campaign manager, but has resurfaced over the weekend with newspapers publishing photographs of the wads of banknotes.
Lula denies ever engaging in smear tactics and says he has been let down by party colleagues, but faces an investigation by Brazil's federal electoral court.
It follows controversy last year over alleged bribes for votes in congress, which led to the resignation of the party's leader and several high-level colleagues.
Lula, the son of an illiterate peasant family who worked as a peanut seller and shoe cleaner as a boy, also failed to turn up for a televised debate against his rivals on Thursday.
His policies, including raising the minimum wage and broadening state help to the poorest families, have reduced the number of Brazilians living in poverty.
But many commentators argue that his programmes fail to address the structural problems that underpin poverty, such as education.
And although Brazil has seen steady annual growth under his government, some business leaders argue it is losing the competitive edge against international rivals.
Also running for president is Heloisa Helena, who was expelled from the president's Workers' Party and claims to represent the voice of the true left.
If no candidate achieves 50% of the vote, a run-off between the top two contenders will take place in four weeks' time.