Russian President Dmitry Medvedev has fired Moscow's powerful mayor, Yuri Luzhkov.
Mr Luzhkov, 74, was being removed because he had lost "the trust of the president of the Russian Federation", a presidential decree said.
In recent weeks Mr Luzhkov - who has been in office since 1992 - had faced harsh criticism from the Kremlin.
Mr Luzhkov accused opponents of mounting a concerted campaign "of lies and slander".
Mr Luzhkov is one of Russia's most powerful politicians and is a senior member of the pro-Kremlin United Russia party - but he complained of being abandoned by the party.
"Recently, being one of the party's leaders, I have been fiercely attacked by state mass media, and the attacks were related to the attempts to push Moscow's mayor off the political scene," Mr Luzhkov said in a resignation letter to the party.
He said he felt the party "did not provide any support, did not want to sort things out and stop the flow of lies and slander".
"As the president of Russia I lost my trust in Yuri Mikhailovich Luzhkov as the mayor of Moscow," Mr Medvedev told journalists during a visit to China.
"I will decide who will lead Moscow."
However, Vladimir Putin suggested he would influence the decision, saying: "I hope I will have a chance to express my opinion."
Mr Putin praised the former mayor as "a symbolic figure in modern Russia".
But he backed the president's announcement, saying: "It is completely clear that the mayor's relations with the president didn't work out The mayor is the president's subordinate and not the other way around - therefore steps had to be taken to resolve the situation."
Before the emergence of Mr Putin a decade ago, Mr Luzhkov was even tipped as a possible future president.
However he was recently the subject of a constant barrage from state-run TV, which criticised him for gridlock on the capital's roads and bulldozing historic buildings.
During this summer's forest fire crisis, when Moscow was choked by smoke and baked in record high temperatures, he was attacked for remaining on holiday.
Mr Luzhkov and his billionaire wife, Yelena Baturina, have been also accused of corruption.
Mr Luzhkov has denounced all the claims as "total rubbish", designed to make him "lose his balance". He has threatened to sue the TV channels concerned.
Commentators believe this battle at the highest level of Russian politics was sparked by a newspaper article written by the mayor in which he appeared to criticise the president and call for a return to stronger national leadership, says the BBC's Richard Galpin in Moscow.
The Kremlin clearly decided Mr Luzhkov had to be pressurised to resign voluntarily or be pushed out, our correspondent says.
On Monday, after returning from a week's holiday in Austria, Mr Luzhkov said he would not stand down voluntarily.
Mr Medvedev then acted. He is entitled, under the constitution, to fire the Moscow mayor and regional governors, and appoint successors without popular elections.
Reaction from readers in Moscow
These are a selection of comments sent in by readers of BBCRussian.com
The lawfully elected mayor, who is trusted by the majority of Muscovites, has been dismissed with the wording "has lost the trust of the president of Russia". But why should I wait for the person who will be responsible for the wellbeing of my home city to be appointed from above? Why am I not allowed to vote for a mayor (and then I could dismiss him if he should lose my trust)?
The list of Luzhkov's sins - both proven and alleged - is long. However the shape which his dismissal took is disgusting. Moscow's 10 million inhabitants were shown that they are considered to be nobodies. Luzhkov's dismissal has nothing to do with fighting corruption. I don't think the change of mayor will do Moscow any good. Now all the money will go to the clan from St Petersburg.
I am very sorry that Luzhkov has been fired. He did a lot for the city - just remember what the roads were like before he became mayor. He built the third ring road around Moscow, he increased pensions and child benefit. And yet nobody has thanked him for this. And now the media are arousing jealousy and spite in people, putting them up against Luzhkov. He was the last mayor really elected by Muscovites - his dismissal is the end to democracy in Russia.
[Russian president Dmitry] Medvedev has taken the first step towards breaking the back of the corruption monster.
It is scary to imagine how long it will take Moscow to recover from Luzhkov's rule.
Who could feel sorry for Luzhkov? Only thieves and bureaucrats. And in Russia these two words have come to mean the same thing. What good has Luzhkov done? Nothing. He spent the budget as he pleased. OK, he did raise salaries and pensions. But any other mayor of a capital city would have done so too. Many things that Luzhkov is credited with are not his achievements. I am glad that the media have at last exposed all the corruption, although they only did this once they were given a signal from the Kremlin.
Luzhkov has always lived in Moscow. And after he was elected mayor he cleaned the city up, made it tidy and well-lit. Moscow has the highest pensions in Russia. Luzhkov did all he could for Moscow.
Luzhkov brought crowds of migrants to Moscow, what are we going to do about them now?
I think Medvedev made a mistake when he dismissed Luzhkov. He must have followed advice from stupid people. It is possible that Muscovites will stage protests against the dismissal, as Luzhkov has done a lot for them, more than any other mayor or governor in Russia.
Alexander Ustinov, Moscow
I hope that the problems that Luzhkov was blamed for will be gradually resolved. I mean traffic jams specifically. If, under the new mayor, things remain the same, nobody will allow him hold on to his post for 18 years.