Oil giants British Petroleum (BP  ) and Shell (SHL  ) have both announced that they will be exiting their stakes in the Russian oil market due to Russian President Vladimir Putin's actions against Ukraine. The companies' Russian holdings are both worth billions of dollars.

BP came first with its February 27 declaration that it would be selling its 20% stake in Russia state-controlled oil company Rosneft (OJSCY  ) . London-based BP has worked in Russia for more than three decades, and one-third of the company's oil and gas production came from the country.

Prior to BP's declaration, British government officials including Prime Minister Boris Johnson argued strongly in favor of reducing the country's reliance on Russian energy.

"I welcome BP's decision to exit its shareholding in Rosneft oil company," British business and energy secretary Kwasi Kwarteng said on Twitter (TWTR  ). "Russia's unprovoked invasion of Ukraine must be a wake up call for British businesses with commercial interests in Putin's Russia."

The following day, Shell made its announcement regarding its exit from Russia. The company stated that it would be exiting its joint venture with Russian natural gas giant Gazprom (OGZPY  ), representing investments worth $3 billion. Previously, Shell worked hard to build a relationship with Gazprom, including by providing financing for the now-blocked Nord Stream 2 pipeline meant to stretch from Germany to Russia.

"We are shocked by the loss of life in Ukraine, which we deplore, resulting from a senseless act of military aggression," reads a statement from Shell chief executive Ben van Beurden.

Other smaller energy companies like Norway's Equinor have also announced that they will begin pulling out of Russia, and other major companies like ExxonMobil (XOM  ) and French energy giant TotalEnergies (TTE  ) are facing considerable pressure to do the same. TotalEnergies has the most to lose in Russia now that BP and Shell have left.

Pulling out of Russia, one of the world's largest energy producers, will likely result in lost profits for these energy companies, but the damage won't be as significant as it would have been ten years ago.

According to experts, Russia held massive opportunities for energy companies following the fall of the Soviet Union. Companies like BP moved in to help the country develop its oil production operations.

Since then, Russia has caught up with the rest of the world's oil production technology, meaning big players like BP and Exxon are no longer as important for the country's economic stability. More recent actions like the 2014 annexation of Crimea have also highlighted the potential risks of investing in the Russian economy.

"If you look back 15 to 20 years ago, the assumption was that Russia would become a normal part of the European economic system," Redburn analyst Stuart Joyner told The New York Times.

Investors have shown some hesitation following the two withdrawal announcements: BP, Shell, and TotalEnergies have each seen share price decreases.

Both BP and Shell companies have proposed write-offs for the first quarter of 2022, $11 billion for BP and an unspecified amount for Shell. There are signs that the companies don't expect to see significant losses, including Shell's proposed $8.5 billion in stock buybacks for the first quarter.