Long before he became president, Barack Obama wanted to establish some distance between the US and Saudi Arabia. During a 2002 speech against the Iraq war that eventually propelled his presidential bid, Mr Obama referred to the Saudis as “our so-called allies”.
In an article on the “Obama Doctrine”, published last month in The Atlantic magazine, Australian prime minister Malcolm Turnbull was quoted as asking the president: “Aren’t the Saudis your friends?” Mr Obama replied: “It is complicated.”
With a hint of “be careful what you wish for” in the air, the consequences of Mr Obama’s effort to reshape the relationship with the Saudis will be on display when he visits Riyadh on Wednesday and Thursday for a bilateral meeting and a regional summit.
He will be greeted by Saudi hosts quietly seething at their country being called a “free-rider” by the US president and looking past the election to see if the next occupant of the White House will try to restore the close relationship of the 1980s and 1990s.
But he will also meet a Saudi royal family that has in some ways taken the president at his word and taken more regional security matters into its own hands — in ways that have not always been to the liking of the White House.
“It is like this catch-22 where we want them to be more responsible for their own security, but when they do it, it can be ineffective and destabilising in the region,” says Frederic Wehrey at the Carnegie Endowment.
On Thursday Mr Obama will meet leaders of the Gulf Cooperation Council, the regional grouping that the administration has urged to work together more closely to deal with threats from Iran and other security issues.
Ashton Carter, US defence secretary, will meet his GCC counterparts on Tuesday to discuss missile defence and protecting against cyber attacks.
James Smith, US ambassador to Saudi Arabia during Mr Obama’s first term, says: “From the start, there was a strategy of urging them to become more self-sufficient.”
While being urged to take more responsibility, the Saudis have found plenty of reason to question Mr Obama’s commitment. Even before the negotiation of a nuclear deal with Iran, their great regional rival, Riyadh criticised the president for not backing former Egyptian ruler Hosni Mubarak in 2011 and for not doing more to defeat the Assad regime in Syria.
The culmination of these frustrations has been the Saudi-led campaign in Yemen, which Riyadh says is aimed at restoring a legitimate government overthrown by an Iran-backed rebellion. While the US has provided some military support, it has privately criticised Riyadh for the humanitarian impact of the conflict.
Saudi irritation at the Obama administration has been matched in part by a revival of the sort of criticism of Saudi society that was common in the US after the 9/11 attacks. A bipartisan bill that would strip legal immunity for Saudi officials found to be involved in terrorist attacks in the US stands a good chance of passing the US Senate this year.
Democratic senator Chris Murphy has proposed a bill that would limit arms sales to Saudi Arabia in protest at the war in Yemen.
Perry Cammack, a former state department official, says: “I think their [the Saudis’] hope is that with a new presidency, things will revert back to how they have been for decades, but there have been some deeper structural changes in the relationship.”
Yet for all the friction, the Obama administration has maintained — and in some ways enhanced — traditional collaboration with Saudi Arabia. This will be Mr Obama’s fourth visit, the most by any US president. The administration has also signed a record number of arms contracts with Riyadh, which surpassed Moscow to become the world’s third-largest arms spender last year, and works closely with the Saudis on counter-terrorism.
Saudi Arabia made corporate America its first port of call when trying to lure overseas investment to help transform the economy for a post-oil era, and US exports to the kingdom continue to expand.
Derek Chollet, former senior Pentagon and White House official in the Obama administration, says: “It is not as clean as we are either close to Saudi Arabia, or we are not. This is an important partnership. What Obama has been trying to do is have it evolve so that it can be sustained over time.”
For its part, Riyadh wants more indication that the US will remain steady in its commitment to the region, and will prevent Iran taking advantage of the nuclear deal signed last year.
A senior Saudi adviser says: “Whenever we meet the Americans, it is clear that we have a special relationship, with overwhelming energy put into fostering that relationship. I think the Americans have already shown enough their confirmation of strength in our relations. We are just being more honest with each other.”