He alleged there had been "inconsistencies" and "serious evidence of fraud", and said that if he lost he would call for a ballot-by-ballot recount.

Left-wing supporters gathered in Mexico City's main square, the Zocalo. A few tried to break down the gates to the IFE offices but were stopped by fellow demonstrators.

Mr Lopez Obrador has urged his supporters to remain calm, but has warned that "the stability of the country hangs in the balance".

The prospect of lengthy legal battles and street protests over the results has raised fears of unrest in a neighbouring country that is key to US interests over drugs, immigration and security.

Big test

The head of the electoral institute (IFE), Luis Carlos Ugalde, told a new conference late on Wednesday that final results would only be released when absolute confirmation was available, to avoid any confusion.

Mr Lopez Obrador has called for a recount of all 41 million votes

The IFE will hand the final result over to a seven-judge tribunal and legal proceedings are then almost certain to begin.

Once the count is complete, the Federal Electoral Tribunal, the ultimate arbiter of disputes, will consider any formal complaints.

Mexico's election system, once mired in corruption, vote-buying and intimidation, has improved over the last decade.

The electoral institute, created in 1990, is independent of government and highly regarded but it is facing its biggest test so far.

The successor to President Vicente Fox is due to be inaugurated on 1 December.