By Robert Plummer
Predictably enough for a 21st Century Latin American leftist politician, Mexico's Andres Manuel Lopez Obrador tends to be portrayed as either a Lula or a Chavez figure.
Mr Lopez Obrador called for civil resistance to the Congress decision
For his admirers, his high standing in the polls after four years as mayor of Mexico City demonstrates that he has the same pragmatism and cross-party appeal as Brazil's well-regarded president.
But for others, his often high-handed attitude towards his own city council and his lavish spending on welfare programmes are more reminiscent of the Venezuelan leader's populism.
At the end of July, Mr Lopez Obrador stepped down as mayor in order to campaign full-time for the presidency of Mexico at next year's elections.
But three months earlier, it seemed Mr Lopez Obrador might not have had the chance to prove himself one way or the other - not in the 2006 presidential race, at least.
The Mexican Congress voted to strip him of his immunity from prosecution on charges of ignoring a court ruling in a land dispute, a move which could bar him from the poll.
Ranged against him were not only the National Action Party (PAN) of President Vicente Fox, but also the political force that was once the only route to high office in Mexico - the Institutional Revolutionary Party (PRI).
But now, it seems, Mr Lopez Obrador may be back on track.
Mr Fox has fired the attorney general - who headed attempts to prosecute the mayor - in an apparent effort to resolve the row.
The episode says a great deal about Mexico's fitful transition to full democratic accountability.
That process was kick-started in 2000, when the previously all-powerful PRI lost its grip on the presidency after 71 years.
But the party has deep roots. Mr Lopez Obrador himself began as a typical PRI machine politician in his home state of Tabasco before jumping ship to the left-wing Party of the Democratic Revolution (PRD).
His star quality came to the fore during the 1994 elections for state governor, in which he gained 40% of the vote - although he was outgunned and outspent by his PRI opponent.
Huge crowds have rallied in support of the mayor
Rising swiftly through the PRD ranks, he was elected mayor of Mexico City in July 2000 and took office in December for a six-year term.
He showed a tendency towards headline-grabbing gestures just a few months after taking office, when he took on President Fox by refusing to put the clocks forward for daylight savings time.
In the end, he gave way in that particular dispute. But his timekeeping continued to make an impression, as he established a routine of rising at 0500 and holding a daily news conference at 0615 - then putting in a punishing working day that usually ends at about 2200.
He soon earned a reputation as a man who got things done, implementing welfare programmes and public works projects that increased his standing among the poor and disadvantaged.
However, the city's level of debt rose as a result, and the PRD's initial lack of a majority in the local legislature often drove him to override it using his powers of veto and decree.
His opponents branded him an autocrat - and as he may yet face prosecution for contempt of court, they feel vindicated.
But in a country plagued by corruption, Mr Lopez Obrador's reputation for honesty is highly valued by many citizens of the Mexican capital, who have championed him fiercely at home and abroad.
Huge crowds rallied to oppose the decision by Congress to end his legal immunity in one of the biggest marches Mexico had ever seen.
In an international competition last year to find the world's best mayor, he was beaten only by Edi Rama, a similarly energetic figure who has been credited with transforming the Albanian capital, Tirana.
Competition organisers said those who voted for Mr Lopez Obrador seemed to feel they knew him personally: "Indeed, it would seem inseparable from their reasons for supporting him."
All the signs are that such people are unlikely to turn their backs on Mr Lopez Obrador because of the charges against him, which many Mexicans view as trifling by the standards of past PRI administrations.
But if the affair does remove him from next year's election, the most likely outcome is that the PRI will recapture the presidency - removing any incentive for the, at best, half-reformed party to make any further changes.