A little-known transport official seen as an ally of Russian Prime Minister Dmitry Medvedev will replace a confidant of President Vladimir Putin as the head of Russian Railways, completing a rare shakeup in the Kremlin circle of power.

Medvedev named Deputy Transport Minister Oleg Belozerov August 20 as the new boss of one of Russia's biggest and most important companies, three days after the unexpected departure of Vladimir Yakunin.

Employing almost 1 million people and managing over 85,000 kilometers of tracks, Russian Railways is the third-largest network in the world. The statecompany turned over $27 billion in 2014 and accounts for 40 percent of freight traffic in a country heavily reliant on raw materials and energy exports.

Critics of Yakunin say it was it has been plagued with problems during his 10-year tenure, including chronic mismanagement and overspending at a time when Russia's economy has been hit hard by a collapse in global oil prices and Western sanctions over Moscow's interference in Ukraine.

Yakunin's sudden exit has prompted speculation that Putin could move other allies out of key positions in an effort to improve results. "It could be that Yakunin's departure is a signal to the Russian elite -- in a crisis, no one is untouchable," a Russian government source told Reuters news agency.

Yakunin got an indirect dressing-down from Medvedev, who told Belozerov that the railway company's budget and investments need attention.

"There are many complaints. People are not happy that journeys are being cancelled. But on the other hand, the railway should be making money and not be posting losses," state-run RIA quoted Medvedev as saying, alluding to Yakunin's performance in a rare public criticism of a Putin ally.

Russian Railways returned a net loss of 99.32 billion rubles ($1.5 billion) in 2014, against earnings of 352.6 billion rubles. It will need 460 billion rubles ($6.8 billion) in government subsidies to ensure net profit up to 2020, Vedomosti newspaper reported in March.

Belozerov, 22 years younger than Yakunin at 45, was born and studied economics in St. Petersburg, the hometown of Putin and Medvedev.

Belozerov worked for Putin indirectly from 2000-2001,when he managed finances for the president's representative in Russia's Northwestern Federal District, which includes St. Petersburg.

From 2004 to 2009, Belozerov ran the state highways agency, a tough task given the abysmal quality of Russia's roads.

Belozerov was quoted by Interfax as telling Medvedev that he plans to focus on improving the efficiency of Russian Railways.

Yakunin is slated to become a member of Russia's upper parliament house, the Federation Council, which is sometimes used as repository for officials the Kremlin wants to sideline without making them into enemies.

The U.S. Treasury Department named Yakunin as Putin's "close confidant" when it imposed personal sanctions on him after Russia's annexation of Crimea from Ukraine last year.

But his removal as Russian Railways chief sparked rumors of a possible fall from favor.

The company has been accused of failure to modernize the company, and faced criticism over major network disruptions and allegations of corruption.

An attempt to overhaul local commuter trains late last year led to mass outages and a public outcry from angry Russians unable to get to work.

A Reuters investigation found that under Yakunin, Russian Railways had paid billions of dollars to private contractors with shady owners and little or no presence at their registered headquarters.

Yakunin's image has been harmed by reports of lavish home outside Moscow.

One federal government official told Reuters that Yakunin was not consulted about his resignation or replacement.

"Both the resignation and [Belozerov's] appointment happened quickly, in the best Soviet tradition," the official said.

With reporting by Reuters, AP, RIA, and Interfax