MOSCOW  President Dmitri A. Medvedev has long endured questions about whether he truly rules Russia or is merely a figurehead manipulated by Vladimir V. Putin, the former  and possibly future  president. On Tuesday, Mr. Medvedev moved to quiet those doubts by ousting a heavyweight political rival, Moscow’s longtime mayor, who had tried in recent weeks to cast Mr. Medvedev as a weakling unfit to run the Kremlin.

Mr. Medvedev’s decision, perhaps the most consequential of his tenure, seemed intended to make clear to Russia’s political class that he was an assertive leader and a viable candidate for president in 2012. His authority has been increasingly undermined because Mr. Putin has pointedly refused to exclude seeking a return to the presidency himself.

“Today, it looks like Medvedev is finally deploying the powers of his own presidency and, for the first time in two and half years, is demonstrating that he is the one who is the president,” said Leonid Radzikhovsky, a political commentator in Moscow. “This is how it is being perceived around the country. It is also a serious signal about his objectives in 2012.”

But as is often the case in Russia, where top politicians’ intentions are difficult to divine, there is an alternate view of the fallout from the removal of the mayor, Yuri M. Luzhkov. Mr. Medvedev is instead described as having been damaged because it took him too long to dismiss Mr. Luzhkov, who dominated the Moscow government for nearly two decades.