Saudi Arabia and Russia have very little in common. Except for oil.
For years, the world's biggest oil producers have clashed over Middle East politics and battled for energy market share.
But their desperate need to rescue oil prices brought them together last year and that partnership was the focus of talks Thursday between King Salman and President Vladimir Putin in Moscow.
It was the first ever state visit by a Saudi monarch to Russia, and both sides were looking to broaden the relationship.
But oil was front and center. Russia and Saudi Arabia have often competed for energy market dominance. They are engaged in an intense battle over who will be the top supplier to China, a major energy importer with an insatiable appetite for crude.
Together they produce about a quarter of the world's oil and last year clinched a deal designed to eliminate a global supply glut, in part triggered by the rapid rise in American production.
The deal between OPEC, led by Saudi Arabia, and several non-OPEC countries including Russia, to curb supply has helped stabilize markets but has yet to boost prices enough to ease the pain for oil-dependent economies.
Extending oil output curbs?
The agreement has already been extended once to continue through March 2018. Now there's talk of another extension -- possibly until the end of 2018.
"We are committed to continuing positive cooperation between our nations to achieve stability on the global oil markets," King Salman was reported as saying by Russian state news agency Tass.
Related: Saudi Arabia's vague economic shift leaves huge oil IPO on track
The talks took place against a difficult political backdrop. Saudi Arabia and Russia backed different sides in the war in Syria. And Russia is close to Iran, a fierce adversary of Saudi Arabia despite their status as OPEC members.
In addition, Saudi Arabia is trying to build a closer relationship with President Trump and his administration, while the U.S. has sanctioned Russia over its involvement in the Ukraine crisis.
Analysts say King Salman and President Putin would try to put those differences behind them.
"Both countries are looking to reap political and economic benefits during the visit," said Yury Barmin, an expert at the Russian International Affairs Council.
"The Russians are looking to perpetuate their image of a leading power in the Middle East, while Riyadh is hedging its bets for regional partnerships at a time when the United States is scaling down its presence in the region."
Tass reported that Moscow is hoping Saudi Arabia investment in Russia will surpass $1 billion after the visit. Barmin was cautious.
"In 2015, Saudi Arabia pledged $10 billion to invest in Russia but two years on nothing has been invested," he said.
Russian Energy Minister Alexander Novak told Al Arabiya TV this week that the two sides plan to launch a $1 billion fund to invest in energy projects, without giving further details.
Russian arms sales?
A Saudi-Russian business forum is also taking place during the King's visit. Top officials, energy ministers and leaders of sovereign wealth funds were due to attend, including Amin Nasser, CEO of Saudi oil giant Aramco.
Defense was another topic. Saudi Arabia is one of the biggest spenders in the world. It has allocated 191 billion riyals ($51 billion), or 21% of its 2017 budget, to military spending.
"Moscow has been entertaining the idea of selling its weapons to Saudi Arabia but it seems that Riyadh is not ready to go that far," Barmin told CNNMoney.
Tass reported Thursday that Saudi Arabia was interested in buying Russia's S-400 air defense missile system.
"There is some interest, of course," he said. "Talks on S-400 are in progress, but there are no final decisions yet," Tass quoted Russian Deputy Prime Minister Dmitry Rogozin as saying.
Related: The man leading Saudi Arabia's overhaul just got more powerful
Saudi Arabia does most of its trading with the United States but may be looking to diversify that.
Vision 2030, a blueprint for Saudi Arabia to move its economy away from oil, is driving that change.
"The Russians have gone out of their way to welcome the Saudi King, hoping to open a new page in relations with the wealthy kingdom," said Fawaz Gerges, professor of International Relations at the London School of Economics.
"The stakes are as high for Moscow as for Riyadh."