When President Trump chose Riyadh to make his debut on the world stage last year, he was placing a bet on Saudi Arabia, which serenaded him with military bands, dazzled him with a flyover of fighter jets and regaled him with a traditional sword dance.

The mastermind behind that wager — the White House adviser who convinced Trump to visit Saudi Arabia for his maiden foreign trip and who choreographed a veritable lovefest between the new president and the desert kingdom’s white-robed ruler, King Salman bin Abdul Aziz — was Jared Kushner.

The president’s son-in-law has carefully cultivated a close partnership with the heir to the Saudi throne, Crown Prince Mohammed bin Salman, whom Kushner has championed as a reformer poised to usher the ultraconservative, oil-rich monarchy into modernity.

But the U.S.-Saudi alliance — and the relationship between Kushner, 37, and Mohammed, 33 — is now imperiled by the un­explained disappearance and ­alleged gruesome murder of ­Jamal Khashoggi, a Saudi journalist who had been living in the United States and wrote columns for The Washington Post. The suspected killing has sparked inter­national outcry and calls for tough punishment of Riyadh.

Kushner, however, has already signaled that he has no intention of turning his back on the crown prince, known by the initials MBS. Trump himself has threatened “extreme punishment” even while repeatedly casting doubt on the Saudi regime’s guilt and the effectiveness of tough measures.

“It’s placed President Trump and the administration now on a tightrope, and we will see how they perform,” said James C. Oberwetter, a U.S. ambassador to Saudi Arabia under President George W. Bush.

As Kushner and his father-in-law see it, the partnership has paid dividends in the form of Saudi pledges to purchase billions of dollars worth of U.S. weaponry as well as the kingdom’s position as an Arab ally in countering Iran and in fighting extremism throughout the Middle East, according to administration officials.

Trump and Salman together convened 54 Muslim leaders to jointly condemn terrorism at a Riyadh summit in May 2017. And the Saudis built a center to combat extremist ideology, which Trump inaugurated during his trip by placing his hands on a glowing orb.

Kushner has celebrated Mohammed’s moves to modernize the Saudi economy and long-repressed society, including allowing women to drive and encouraging women’s entrepreneurship. Furthermore, he considers MBS an influential and wise sounding board on geopolitics in the Muslim world and holds out hope that the crown prince might eventually deliver the support of Saudi Arabia — home of the two holiest sites in Islam — for his foundering ­Israeli-Palestinian peace plan.

But the Khashoggi crisis has become a reckoning for Kushner.

“I have a sense that they put all of their chips on the hope that the Saudis would be able to help the United States, not only in dealing with the challenges of terrorism, but also in dealing with peace in the Middle East,” said Leon Panetta, a defense secretary and CIA director under President Barack Obama.

Khashoggi, who wrote columns critical of Prince Mohammed, is said by Turkish authorities to have been killed and dismembered inside the Saudi ­Consulate in Istanbul. In conversations intercepted by U.S. intelligence, officials in Saudi Arabia earlier discussed plans to lure Khashoggi back to his native Saudi Arabia and detain him. The plot, U.S. intelligence officials believe, was ordered by the crown prince.

Kushner was not briefed about the plot before Khashoggi’s disappearance, according to two people familiar with his knowledge of the matter. It would not be automatic for a senior White House adviser to be briefed on every new piece of intelligence in a region, unless officials decided it needed to be elevated to his or her attention, former national security officials say.

Kushner personally asked Mohammed last week about Khashoggi’s disappearance and the crown prince denied any involvement, Trump said. “They deny it every way you can imagine,” the president said in an interview that aired Sunday on CBS’s “60 Minutes.”

Critics of the Trump administration say Kushner has been dangerously naive to trust Mohammed and has allowed himself to be manipulated by an ascendant royal who charms foreigners yet has been ruthless in consolidating power inside the kingdom.

Kushner declined to comment on his relationship with Mohammed. His defenders say he has been realistic about Mohammed’s power and unafraid to chide the prince privately when he disagrees with his tactics but still believes there are long-term benefits in maintaining a close relationship.

“I don’t think they were played by him,” Sen. Marco Rubio (R-Fla.) said Sunday on CNN, referring to the Trump administration and Mohammed. “I think that they wanted to put together a Middle Eastern strategy in which a less-than-perfect government was a key component of constraining Iranian ambition in the region.”

U.S. intelligence officials who have been warily watching Mohammed’s rise since before he was appointed crown prince in June 2017 said they assessed him as a naive, inexperienced and ambitious upstart who was not prepared for a position of great power. They said they heard an echo of Mohammed in Kushner. Here, too, was a young, power-hungry “prince” with no track record in government.

“Prince Mohammed is a very shrewd, very smart, very capable guy,” said Joseph W. Westphal, a U.S. ambassador to Saudi Arabia in the Obama administration. “He’s a very quick study. And I think he knows, or has certainly learned, much about our system and our politics.”

Mohammed and Kushner became close early on in the Trump administration. They struck up a friendship at a White House lunch in March 2017 and had private, one-on-one phone calls that took senior intelligence leaders by surprise and worried career national security officials because note-takers were not always present, according to multiple people familiar with the relationship. One Trump adviser said it was “insane” how much Kushner spoke with Mohammed. The contents of some of those conversations remain a mystery.

Administration officials said that since those early months, Kushner has had key national security officials present for his conversations with Mohammed or has later briefed them.

“Jared has always meticulously followed protocols and collaborated with colleagues regarding the relationship with MBS and all of the other foreign officials with whom he interacts,” said a White House official, who spoke on the condition of anonymity to discuss Kushner’s practices.

Nevertheless, anxiety grew among some U.S. spies when they learned that foreign officials in at least four countries had privately discussed ways to manipulate Kushner by taking advantage of his complex business dealings, financial difficulties and lack of foreign policy experience, according to current and former U.S. officials familiar with the intelligence about those discussions. One of the countries was the United Arab Emirates, a key Saudi ally.

One senior U.S. intelligence official said that Kushner has come under the influence of Mohammed’s simplistic view of power dynamics in the Middle East. “MBS has an elevator pitch,” this official said, that Kushner has bought into: Iran is the main enemy and the single obstacle to peace and stability in the Middle East.

The reality is far more complicated. But this official said Kushner has appeared uninterested in studying the nuances of security dilemmas in the region and has skipped some intelligence briefings before some high-stakes negotiations.

Kushner sold Trump and administration colleagues on the idea that Mohammed, like Kushner, was a reformer looking to shake up old alliances and break up corrupt power blocs within his country. Kushner privately argued for months last year that Mohammed would be key to crafting a Middle East peace plan, arguing that, with the prince’s blessing, much of the Arab world would follow, according to people with knowledge of the internal deliberations.

Kushner persuaded Trump to make Saudi Arabia his first foreign visit as president against the initial objections of then-Secretary of State Rex Tillerson, who as ExxonMobil’s chief executive had extensive experience negotiating with the Saudis and other Arab states. “It was their premier disagreement,” said the Trump adviser, who spoke on the condition of anonymity to be candid.

Tillerson, Defense Secretary Jim Mattis and others in the U.S. government were skeptical of Mohammed’s follow-through and of Saudi promises to help the United States counter Iran’s influence and destroy the Islamic State, according to the people familiar with the deliberations, who requested anonymity because they were not authorized to speak about them to reporters.

Trump put Kushner in charge of drafting a peace proposal for Israel and the Palestinians both because of Kushner’s long ties to Israel and because his authority as a Trump family member would be readily understood in Arab family dynasties, such as the one in Saudi Arabia.

In July, however, the Saudis delivered a setback. After the Trump administration recognized Jerusalem as the capital of Israel, King Salman publicly rejected Kushner’s peace plan and reassured the Palestinians that Saudi Arabia would not make the concessions that the United States sought for Israel. The plan stalled, and Kushner was startled and angry at the Saudi response, according to diplomats familiar with his reaction.

Trump is expected to soon present a reworked package, but it is not clear whether the Saudis will provide the diplomatic backing and financial support that Kushner has sought.

“It all smacks of a massive naivete on his part that he could sit down with MBS and figure out Middle East peace and a broader framework” involving Arab states that want a durable solution, said Thomas Wright, a senior fellow at the Project on International Order and Strategy at the Brookings Institution.

The administration voiced little public criticism when Mohammed seemed to overstep with the detention last fall of leading Saudi business executives and a bizarre episode involving what may have been the brief kidnapping of the Lebanese prime minister, nor when the Saudi crown prince picked a diplomatic fight this year with Canada, a close U.S. ally.

In general, Trump’s critics have said, the president’s admiration for strongmen and his reluctance to champion human rights and democracy make authoritarian leaders feel empowered because they do not fear U.S. retaliation.

“The Jared-MBS relationship revolves around the Middle East peace process, and the hope that Jared had for the Israeli-Palestinian issue,” said Gerald Feierstein, a former U.S. ambassador to Yemen and former senior State Department official who is now policy director at the Middle East Institute, which has hosted Khashoggi.

But, Feierstein said, “MBS for his own reasons has played along and given the administration reason to believe that the Saudis will do more than I believe they ever will.”