MOSCOW — Russia's prime minister submitted his resignation Wednesday as part of a surprise government shake-up directed by President Vladimir Putin as he looks to an eventual transition of power and to ensure his influence after his term ends in 2024.

Putin accepted the resignation of Dmitry Medvedev, a longtime ally and political partner who once served as president. Medvedev, however, will remain in Russia's power structure as the Security Council's deputy chairman, which has been compared to a vice presidency.

Less than three hours after Medvedev's resignation, Putin offered the post of prime minister to Mikhail Mishustin, the head of the Russian tax service who is viewed as a possible placeholder as Putin reshapes Russia's power structure.

The sweeping moves came shortly after Putin gave his annual address to Russian lawmakers and proposed major constitutional changes that included transferring more power to parliament, including the ability to name the country's prime minister. Currently, the post is selected by the president.

Putin took advantage of that by promptly nominating Mishustin, who has not been part of Russia's top-tier leadership before.

Putin also called for "enshrining" the state council, an advisory body to the president, in what could be a path for him to maintain significant influence in a different capacity once this presidential term is finished in four years.

Medvedev's resignation means the entire ministerial cabinet is out, too, but it's expected to remain in place until a new government is formed. Putin also gave no immediate indication on Medvedev's successor.

"For my part, I also want to thank you for everything that was done at this stage of our joint work, I want to express satisfaction with the results that have been achieved," the president told a meeting of the Cabinet.

"Not everything was done, but everything never works out in full," Putin said, without giving details.

Medvedev served as Russia's prime minister since 2012 and spent four years before that as president in 2008-2012. He said the decision to resign was because the constitutional changes, when passed, will affect the whole balance of the executive, legislative, and judicial branches of government.

"In this context, it is obvious that we as the government should allow our country's president to make all necessary decisions before that," Medvedev added.

Mishustin, who had been with country's tax service for 10 years, was a surprise pick to replace Medvedev because of his relatively low-profile nature. That suggested that Putin may not view the prime minister as his political heir as president after 2014, and could select among other high-ranking official vying for the role.

Andrei Kolesnikov, a senior fellow and the chair of the Russian Domestic Politics and Political Institutions Program at the Carnegie Moscow Center, called the day's events "absolutely unprecedented."

"There has been nothing similar in the history of the Soviet Union or post-Soviet Russia," he said.

Medvedev's move to Russia's Security Council, second to only Putin, has added to speculation that Putin may be looking to copy the path of a Soviet republic, Kazakhstan, on how to retain power past his presidency. Last March, Kazakhstan's long-serving president, Nursultan Nazarbayev, stepped down but became Chairman of the Security Council for life - making him the effective power broker.

In his speech to parliament Wednesday, Putin again suggested limiting presidential term limits to two. That indicated, he won't attempt to seek a third consecutive term. He also set out plans to shift power away from the presidency to the lower house of parliament - a move that erodes the influence of his successor.

"This is all about how to influence the prerogatives of the future president," said Tatiana Stanovaya, the head of a think tank called R. Politik. "Putin would like to have some leverage, some mechanism to control and to get involved in case his successor makes mistakes or has some disagreements with him."

After Putin served two presidential terms from 2000 to 2008, he swapped places Medvedev, who served one term. Medvedev was widely seen as a caretaker, enabling Putin to retain power behind the scenes, but there was also believed to be a rift between the two halfway through Medvedev's presidency. Putin then took over the presidency in 2012 and was reelected last year.

Stanovaya considers it unlikely Putin would want to be prime minister again after his presidency, but both she and Kolesnikov said chairing a beefed-up state council could be appealing to him.

"He doesn't want to get engaged in routine social and economic policy, like the budget - it's boring for him," Stanovaya said. "He wants to focus on foreign policy, and I think the state council is much more convenient for him. But for that, he will need to make it a constitutional body and significantly enlarge its possibilities."

Putin concluded his speech to parliament, which lasted slightly more than an hour, by recommending the package of amendments be approved by a vote - with passage all but certain. He plans to sign a special decree establishing a date and the rules for putting the changes to a vote, presidential spokesman Dmitry Peskov said, according to the state-run news agency Tass.

Other constitutional changes included limiting the supremacy of international law, raising the residency requirements for presidential candidates from 10 years to 25 years, giving the Russian constitutional Court the right to verify whether adopted laws are in compliance with the constitution before they are signed by the president, prohibiting civil servants from holding foreign citizenship and adding a provision to keep minimum wage and pension above the official poverty line.

"Our society is clearly demonstrating a demand for change," Putin said at the start of the address.

The annual speech to top Russian officials and members of parliament largely focused on how to improve domestic living standards. Putin's approval ratings remain high - at about 68 percent, according to a December poll from the Levada-Center - but it has been gradually declining due to unpopular moves in recent years to raise the retirement age and increase taxes on goods and services.

Kolesnikov suggested Wednesday's bombshell could have been Putin's way of trying to avoid public "discontent with his economic policy" with Russia's economy largely stagnant and corruption rampant.

The state-of-the-nation address was his first to be projected across several large buildings in Moscow. Putin also pointed out that the speech was unique in how early it was delivered; typically such speeches are given in February or March.

"We need to expedite achievement of the large-scale social, economic and technological challenges our country faces," he said.

- - -

The Washington Post's Natalia Abbakumova in Moscow contributed to this report.