Mexico City's leftist mayor has announced he will stand down to concentrate on his campaign for next year's presidential elections.
Mr Lopez Obrador is leading in most polls
Andres Manuel Lopez Obrador told journalists he would continue to govern the city until 31 July.
The announcement comes days after the government decided to drop plans to prosecute Mr Lopez Obrador for contempt of court during a land dispute.
The case sparked a political crisis because the mayor is ahead in polls.
Mr Lopez Obrador had described the planned prosecution as a plot to prevent him from running.
His current term as mayor would have run until December 2006.
The mayor said he would run for president on a platform of greater equality and less injustice.
"I have decided to participate in the primary elections, to represent my party, should voters so decide, as candidate for the presidency," he said.
He pledged to embark on a whistle-stop tour across the country, visiting every electoral district by overland transport in a "low-cost campaign".
He added that he was sure there would be no more legal challenges to his candidacy, in view of the popular support he had received.
"You shouldn't mess with the people, because the people are tough," he said.
Since he took office in December 2000, Mr Lopez Obrador - who belongs to the left-wing Party of the Democratic Revolution (PRD) - has become one of the country's most popular politicians.
There was an unprecedented mass rally in support of the mayor
But he was accused of breaching a court order after allowing the construction of an access road to a city hospital, which is said to go through a disputed plot of expropriated land.
Mexico's Congress removed his immunity last month and opened the way for his prosecution.
But after one of the largest rallies Mexico has ever seen in Mr Lopez Obrador's support, Mr Fox sacked the attorney general in an attempt to defuse the crisis.
Last week, officials said the prosecution had been abandoned because the punishment for the offence he had been accused of was unclear.