NEW YORK - As Russia massed troops on its border with Ukraine and invaded the country at the start of the year, Saudi Arabia's Kingdom Holding quietly invested more than US$600 million (S$844 million) in Russia's three dominant energy companies.
Then, over the summer, as the United States, Canada and several European countries cut oil imports from Russia, Saudi Arabia suddenly doubled the amount of fuel oil it was buying from Russia for its power plants, freeing up its own crude for export.
And, this month, Russia and Saudi Arabia steered the Organisation of the Petroleum Exporting Countries and its allied producers to reduce output targets in an effort to prop up global oil prices, which were falling, a decision that should increase the oil profits of both nations.
Taken together, the moves represent a distinct Saudi tilt toward Moscow and away from the United States, which it has typically aligned itself with.
The Saudi position falls short of an outright political alliance between Crown Prince Mohammed bin Salman of Saudi Arabia and President Vladimir Putin of Russia, but the two leaders have established an arrangement that benefits both sides.
"Obviously, Saudi-Russian ties are deepening," said Bill Richardson, a former US energy secretary and ambassador to the United Nations.
By working more closely with Russia, the Saudis are effectively making it more difficult for the United States and the European Union to isolate Putin.
As Europe gets ready to greatly reduce how much oil it imports from Russia, Saudi Arabia and countries like China and India are stepping in as buyers of last resort.
During the Cold War, Saudi Arabia and the Soviet Union were bitter enemies. Saudi leaders helped finance the insurgency against the Soviet occupation of Afghanistan.
But, in recent years, as hydraulic fracturing of shale fields has led to a boom in US oil and natural gas production that undercuts the power of Opec and other major oil producers like Russia, the two countries have come to see each other as valuable partners with similar interests.
It probably helps that Saudi Arabia is an autocratic kingdom and that Putin has suppressed or eliminated most of his domestic political opposition.
After oil prices collapsed in late 2014 and 2015, Moscow and Riyadh collaborated to prevent US companies from dominating the global energy market.
In 2016, Russia and Saudi Arabia agreed to expand the oil cartel, creating Opec+.
Their partnership has proved enduring with the exception of a brief falling out in early 2020, when the start of the coronavirus pandemic led to a collapse in oil prices and the two countries disagreed on what to do.
"The Russians and Saudis have a similar interest in driving up the price of oil, and the Ukraine war has only reinforced that," said Bruce Riedel, a former Middle East analyst for the CIA and the author of "Kings and Presidents: Saudi Arabia and the United States Since FDR."
Saudi officials have found Russia to be a useful partner in managing Opec+, an often fractious group of oil producers with different ideas of how to manage oil supplies and prices.
The group works closely with Alexander Novak, a former Russian energy minister who is now deputy prime minister.
Analysts describe him as willing to sit with ministers of other oil-producing countries for hours to hear their plans, concerns and grievances.
By announcing a small trim of production earlier this month, Opec+ demonstrated its independence from President Joe Biden, who in July visited Saudi Arabia and exchanged a fist bump with Crown Prince Mohammed.
The visit was widely interpreted as an effort by Biden to restore US-Saudi relations after he criticised the country during the 2020 US presidential election for the killing of Washington Post columnist Jamal Khashoggi.
For months, the president has been encouraging Saudi Arabia to produce more oil.
The cartel's cut in production reversed its policy of gradually increasing production.
Saudi Arabia has often allied itself with the United States, including by quietly backing efforts to improve relations between Israel and its Arab neighbours.
Now, some analysts said, the kingdom appears to be putting a greater emphasis on its financial interests by working closely with Russia even as the United States and Europe seek to isolate and punish Putin for Russia's invasion of Ukraine.
"It's pretty remarkable that Russia has been able to keep Saudi Arabia on side," said Jim Krane, a Middle East expert at Rice University. "Putin's goal is to get between the US and its allies, and, in the case of the US relationship with Saudi Arabia, Putin is making some progress."
Oil executives in the Persian Gulf say Saudi Arabia and other Gulf countries are merely doing what is best for them.
"These decisions are protecting Saudi Arabia's own commercial interests and make tremendous sense from Saudi Arabia's own economic perspective," said Sadad Ibrahim Al Husseini, a former Saudi Aramco executive.
Some Middle East energy executives said the United States and other Western countries had not been reliable partners to oil exporters, in large part because they sought to wean the world off fossil fuels in an effort to address climate change.
"Years of schizophrenic energy policy in Europe and the US have resulted in significant energy security vulnerabilities that large producers are adapting to," said Badr H. Jafar, the president of Crescent Petroleum, an oil company in the United Arab Emirates.
"And the energy chessboard is likely to keep shifting in the months and years to come."