Mexican President Vicente Fox has dismissed the country's attorney general in an apparent effort to end a legal row over the capital's mayor.
Mayor Manuel Lopez Obrador says he is the victim of a plot
Rafael Macedo had headed attempts to bring Mayor Andres Manuel Lopez Obrador to trial, a move which could bar him from a presidential bid next year.
Huge crowds rallied on Sunday in support of the Mexico City mayor.
President Fox said he had acted "to promote national unity" and called for "a calm exchange of ideas".
"The new attorney general will exhaustively review the case against the mayor, while seeking to preserve the greatest political harmony in the country," said President Fox.
Opinion polls have shown Mr Lopez Obrador enjoying a clear lead for the 2006 presidential race, and he says he believes that efforts to prosecute him over a land dispute are an attempt to stop him running.
"My administration will not stop anyone from running in the next federal election," said Mr Fox, after he had dismissed the Mr Macedo.
Although not officially confirmed, presidential counsel Daniel Cabeza de Vaca is tipped to take over as attorney general.
Mexico's Congress removed Mr Lopez Obrador's immunity earlier this month and opened the way for his prosecution on contempt of court charges.
On Monday, he returned to work for the first time since being stripped of immunity.
He has always claimed he is a victim of a political plot to stop him from running for president next year.
On Monday he said: "I am ready for dialogue, I am ready for meetings so that there is unity and conciliation for the good of the country."
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.
Sunday's protest was one of the biggest marches Mexico had ever seen, with thousands travelling from all over the country to attend.
Organisers said 1.2 million people were present, though officials put the number at 120,000.
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.