Want smart analysis of the most important news in your inbox every weekday, along with other global reads, interesting ideas and opinions? Sign up for the Today’s WorldView newsletter.

President Trump enters the last year of his term with an erratic record on foreign policy. He launched trade wars on allies and went soft on strongmen. He talked tough about the primacy of American might but stood aside as other powers reshaped the strategic landscape. He has done some wheeling and tried some dealing. In short, it’s been a bit of a muddle.

The events of recent weeks, though, remind us of one of the most consistent planks of his foreign policy: a firm and enduring embrace of Saudi Arabia.

On Tuesday, the Senate passed an annual defense spending bill that had gone through the House of Representatives last week. Among its provisions, the $738 billion defense policy bill created Trump’s much desired Space Force. But it was stripped of a number of measures that lawmakers hoped would restrict American support for the Saudi-led military campaign in Yemen. According to various reports, those provisions were “nonstarters” for a White House intent on blocking congressional oversight of arms sales and military assistance to the Saudis.

This is hardly an isolated occurrence. The bulk of legislation vetoed by Trump during his presidency has involved congressional attempts to censure Saudi Arabia. In April, Trump vetoed a bipartisan resolution from Congress that invoked its war powers authority and demanded an end to U.S. involvement in the Saudi-led military campaign in Yemen. In July, he vetoed a trio of congressional resolutions that tried to stop him from bypassing legislative oversight and selling billions of dollars of weapons to Saudi Arabia and the United Arab Emirates. A year ago, Trump’s envoys also blocked a U.N. Security Council Resolution drafted by Britain that demanded accountability for war crimes in Yemen.

And when Trump is not axing legislation he deems hostile to Saudi concerns, he’s speaking on the kingdom’s behalf. That was on show this month after a gunman who was a Saudi national killed three people at a naval base in Florida. Trump — who is so quick to cast aspersions on Muslim assailants and the dangers of the lands where they or their parents came from — conspicuously leaped to Riyadh’s defense.

“They are devastated in Saudi Arabia,” Trump told reporters in the aftermath of the attack, unprompted. “And the king will be involved in taking care of families and loved ones. He feels very strongly. He’s very, very devastated by what happened and what took place. Likewise, the crown prince. They are devastated by what took place in Pensacola.”

Even as more evidence emerged about the attack, which the FBI is investigating as an act of terrorism, and other Republican officials grew more hawkish, Trump offered little criticism of the Saudis, who had assigned the suspected gunman to the U.S. naval base on a training mission.

Trump, of course, places a high priority on the U.S.-Saudi relationship. He sees the kingdom as an eager customer for American arms and a useful proxy in Washington’s confrontation with Iran. He made Riyadh the first official foreign destination of his presidency, where he helped unveil a “counterterrorism” center run by the Saudis. His son-in-law, Jared Kushner, has built up a thicket of personal and political contacts with prominent Saudi royals and, in particular, Crown Prince Mohammed bin Salman.

“Trump decided some time ago that he would be in their corner,” Jon Alterman, director of the Middle East Program at the Center for Strategic and International Studies, told my colleagues this month. “And I don’t think that there’s any circumstance under which he would feel the need to rethink that.”

That includes bipartisan outrage over the crown prince’s apparent role in the murder of Saudi dissident journalist Jamal Khashoggi. Contradicting the assessments of his own intelligence community and the views of otherwise loyal Republican lawmakers, Trump has expressed doubt about Mohammed’s culpability in the abduction and murder of Khashoggi, a Washington Post contributor, last year. This month, the White House continued to shield Mohammed from further wrath, removing from the defense spending bill a measure that would immediately revoke the U.S. visa of any Saudi official deemed responsible for Khashoggi’s death.

But Trump’s director of national intelligence will have to provide an official list of people implicated in the plot to kill Khashoggi within 30 days of Trump’s signing the bill. “It is a list, but with no explicit consequences,” a congressional source told CNN. “We needed more than that.”

For all the protection Trump has offered Riyadh, he has secured only modest tangible benefit. The Saudis have cooled on backing Kushner’s quixotic attempt at forging peace between the Israelis and Palestinians.

And that’s not the only arena where the partnership isn’t as rosy as Trump would make out. “Few of the Saudi promises have amounted to much,” noted the New York Times. “The effectiveness of the counterterrorism center in Riyadh remains doubtful. After offering $50 billion in new weapons contracts, the Saudis have signed only letters of interest or intent without any firm deals. After proposing to marshal up to $100 billion in investments in American infrastructure, the Saudis have announced an investment of only $20 billion.”