MOSCOW, Russia — Muscovites woke up this morning to the news that Yuri Luzhkov, their powerful mayor, was leaving office after 18 years.

It’s a move that was long expected. Less predictable was how it happened.

Yuri Luzhkov was fired — dismissed, laid off, given the boot. This is not something that happens to high officials in Russia. The standard scenario has the Kremlin quietly voicing its displeasure with its target. Said official then hands in his resignation, maintaining the illusion that the Russian leadership is so powerful that a mere whisper has underlings shaking in their boots. Luzhkov refused to follow the script, launching an all-out battle that mesmerized the city for weeks.

It was a test that President Dmitry Medvedev, widely assumed to play second fiddle to the country’s powerful prime minister, Vladimir Putin, could not afford to fail.

Medvedev did what presidents do and took action. In most countries, this would constitute a footnote in the story of the rise and fall of a man who led Moscow from post-Soviet dreariness into shiny, gridlocked, capitalist Babylon. Yet Medvedev, with his soft-spoken demeanor and love of blogging, doesn’t take action often. The fact that he fired Luzhkov prompted some to declare it a turning point in his presidency.

Medvedev signed an order stripping Luzhkov of his powers during a state visit to China (the joke of the day in Russia became: “Everything is made in China these days, even orders to fire the mayor of Moscow.”) The decree was published on the Kremlin’s website at 8 a.m.

At a press conference in Shanghai, a stern-looking Medvedev explained the reasoning behind his decision: “I, as president of the Russian Federation, have lost trust in Yuri Mikhailovich Luzhkov as mayor of the city of Moscow.”

Many Russians are saying: Well, it took you long enough.

A survey released last week by the Levada Center, an independent Russian pollster, found that only 3 percent of those surveyed “completely trusted” Luzhkov, while another 17 percent “more or less trusted him.” (Twenty-seven percent said they rather did not trust him and another 27 percent said they “did not trust him at all.”)

What a difference 18 years makes. When Boris Yeltsin, Russia’s first post-Soviet leader, appointed a 56-year-old Luzhkov mayor in June 1992, he quickly built a reputation as a man of action in the midst of dissolution and chaos, earning the nickname khozyain (landlord). Muscovites reveled in the cosmetic changes he made to the city — his rebuilding of the golden-domed Christ the Savior Cathedral in the 1990s was seen as providing solace to a people living in a city that had reached the deepest depths of spiritual decay.

Yet eventually Luzhkov went too far. His preference for the gaudy and grandiose has left the capital littered with sculptures and buildings that will one day likely be named crimes against good taste. The deadly mafia-run protection rackets of the 1990s may have lost their sting, only to be replaced by wholly corrupt municipal and federal officials. Luzhkov himself is believed to have gotten very wealthy from his post — at the very least, his wife Yelena Baturina, head of the Inteko real estate development company, has, amassing a fortune estimated at nearly $10 billion.

The question now is: What comes next?

A poll published late today in Vedomosti, Russia’s leading business paper, found that 59 percent of Muscovites supported Medvedev’s decision, with 19 percent disagreeing and the rest undecided.

That’s something that’s more interesting, rather than important, to note. Russia’s ruling duo will decide who Luzhkov’s replacement is, and Medvedev, according to Russian law, will appoint him.

For now, Medvedev has appointed Vladimir Resin, a former Luzhkov deputy, as interim mayor. Like Luzhkov, Resin is 74, leading many to believe his appointment is a temporary measure. Also like Luzhkov, Resin has a taste for fancy watches — a Vedomosti survey published last year showed him to wear the most expensive watch in the country, sporting a Dewitt worth $1.3 million (in comparison, Medvedev prefers a Breguet that costs just $32,200).

Many Muscovites have no illusions about their future mayor, with few expecting him to be anything but corrupt (perhaps just corrupt in a different way). The Orthodox Action Corporation, a group formed in 2004 to promote the church, issued a statement today thanking Luzhkov for his service to the country and spelling out what the next mayor would do.

“We need a city head who clearly understands that Moscow is the third Rome,” it said in a statement, Interfax reported. Do they know what happened to the first one?