Mexico's Congress is deliberating over whether to strip Mexico City's mayor of his political immunity.
Lopez Obrador is favourite in the polls for next year's elections
Andres Manuel Lopez Obrador, the favourite to win next year's presidential election, says Thursday's vote is a plot to stop him running.
Officials deny the claim, saying no politician can be above the law.
Mr Lopez Obrador told tens of thousands of his supporters in Mexico City's main square that he planned to contest the presidential election.
Mr Lopez Obrador is accused of breaching a court order after allowing the construction of an access road to a city hospital said to go through a disputed plot of expropriated land to continue.
On Saturday, a congressional committee gave the go-ahead for legislators to vote on his legal immunity.
Since these proceedings against the mayor began, his popularity has soared by as much as 10 percentage points, according to one polling organisation.
His populist left-wing policies have earned him comparisons with Venezuelan President Hugo Chavez.
The BBC's Claire Marshall, in the main square, says people have come from all over the country to show their support.
Waving banners and flags and shouting "no" to the impeachment of the mayor, many say the ongoing process is a form of coup.
Addressing the crowd, Mr Lopez Obrador said that he had broken no law.
He said that if Mexico's lower house of Congress voted to strip him of his immunity and a judge ordered his arrest, he would not seek bail and would go to prison voluntarily.
Mr Lopez Obrador also called for peaceful, active civil resistance and for the whole nation to join his alternative project for Mexico.
He then made his way through the crowds to the Congress building.
The result of the vote is expected in the next few hours.