The Mexican government has dropped its contempt of court case against Andrés Manuel López Obrador, removing the last major legal obstacle to the Mexico City mayor's run for the presidency.

The announcement brings to an end a month of high drama in Mexican politics, which included the mayor's impeachment by Congress, a silent march by as many as 1m of his supporters in the centre of Mexico City, and the firing of the attorney-general and the prosecutor who ran the case. It also establishes Mr López Obrador as the clear front-runner for next July's presidential elections.

President Vicente Fox and the mayor are set to meet on Friday to outline the structure for a smooth political transition. They say they will not discuss the impeachment, but the meeting is clearly intended to cool political tensions on all sides.

Daniel Cabeza de Vaca, the former law professor who was appointed attorney-general last week after the firing of his predecessor, Rafael Macedo de la Concha, said that it was possible to show that Mr López Obrador's actions in allegedly ignoring a judicial order during a planning dispute were unlawful, and that he was responsible. But he added: “It is also necessary to verify the existence of a penal sanction, which in our opinion does not exist in this case.”

He said the law did not specify any penalty. By finding a legal formula to end the proceedings against the mayor, Mr Cabeza de Vaca avoided charges of inconsistency against the government, which insisted that the impeachment effort was designed to maintain “strict adherence to the law”.

Mr López Obrador said the charges were politically motivated.

The Supreme Court is still hearing a separate constitutional challenge to the proceedings, which claims that it is the local Mexico City legislature, and not federal Congress, that should have the right to impeach him.

The popularity of Mr López Obrador, a leftist well-known for his handouts to the elderly, new roads to ease choking traffic and for constructing elaborate conspiracy theories, soared after Congress stripped him of his immunity. Because Mexican law has no presumption of innocence, the impeachment proceedings meant the mayor would have been ineligible to enter the race until cleared of the charges.

Get alerts on World when a new story is published

Copyright The Financial Times Limited 2018. All rights reserved.

Comments have not been enabled for this article.

Follow the topics in this article