Senior U.S. officials were worried. Since the early months of the Trump administration, Jared Kushner, the president’s son-in-law and Middle East adviser, had been having private informal conversations with Prince Mohammed bin Salman, the favorite son of Saudi Arabia’s king.

Given Kushner’s political inexperience, the private exchanges could make him susceptible to Saudi manipulation, said three former senior U.S. officials. In an effort to tighten practices at the White House, a new chief of staff tried to reimpose longstanding procedures stipulating that National Security Council staff members should participate in all calls with foreign leaders.

But even with the restrictions in place, Kushner, 37, and Crown Prince Mohammed, 33, kept chatting, according to three former White House officials and two others briefed by the Saudi royal court. In fact, they said, the two men were on a first-name basis, calling each other Jared and Mohammed in text messages and phone calls.

The exchanges continued even after the Oct. 2 killing of Jamal Khashoggi, the Saudi journalist who was ambushed and dismembered by Saudi agents, according to two former senior U.S. officials and the two people briefed by the Saudis.

As the killing set off a firestorm around the world and U.S. intelligence agencies concluded that it was ordered by Crown Prince Mohammed, Kushner became the prince’s most important defender inside the White House, people familiar with its internal deliberations say.

Kushner’s singular bond has helped draw President Donald Trump into an embrace of Saudi Arabia as one of his most important international allies.

But the ties between Kushner and Crown Prince Mohammed did not happen on their own. The prince and his advisers, eager to enlist U.S. support for his hawkish policies in the region and for his own consolidation of power, cultivated the relationship with Kushner for more than two years, according to documents, e-mails and text messages reviewed by the New York Times.

A delegation of Saudis close to the prince visited the United States as early as the month Trump was elected, the documents show, and brought back a report identifying Kushner as a crucial focal point in the courtship of the new administration. He brought to the job scant knowledge about the region, a transactional mind-set and an intense focus on reaching a deal with the Palestinians that met Israel’s demands, the delegation noted.

Even then, before the inauguration, the Saudis were trying to position themselves as essential allies who could help the Trump administration fulfill its campaign pledges. In addition to offering to help resolve the dispute between Israel and the Palestinians, the Saudis offered hundreds of billions of dollars in deals to buy U.S. weapons and invest in U.S. infrastructure. Trump later announced versions of some of these items with great fanfare when he made his first foreign trip: to an Arab-Islamic summit in Riyadh, the Saudi capital. The Saudis had extended that invitation during the delegation’s November 2016 visit.

“The inner circle is predominantly deal-makers who lack familiarity with political customs and deep institutions, and they support Jared Kushner,” the Saudi delegation wrote of the incoming administration in a slide presentation obtained by the Lebanese newspaper Al Akhbar, which provided it to the Times. Several Americans who spoke with the delegation confirmed the slide presentation’s accounts of the discussions.

The courtship of Kushner appears to have worked.

By March, Kushner helped usher Crown Prince Mohammed into a formal lunch with Trump in a state dining room at the White House, capitalizing on a last-minute cancellation by Chancellor Angela Merkel of Germany because of a snowstorm.

“The relationship between Jared Kushner and Mohammed bin Salman constitutes the foundation of the Trump policy not just toward Saudi Arabia but toward the region,” said Martin Indyk, a fellow at the Council on Foreign Relations and a former Middle East envoy. The administration’s reliance on the Saudis in the peace process, its support for the kingdom’s feud with Qatar, a U.S. ally, and its backing of the Saudi-led intervention in Yemen, he said, all grew out of “that bromance.”

Top aides to the prince met with Kushner on a trip to New York in November 2016, after the election.

Within weeks of Trump’s move into the White House, Kushner had embraced the delegation’s proposal for the president to visit Riyadh, according to a person who discussed it with Kushner and a second person familiar with his plans.

By around March 2017, senior officials in the State Department and the Pentagon began to worry about the one-on-one communications between Crown Prince Mohammed — who is known to favor the encrypted online messaging service WhatsApp — and Kushner. “There was a risk the Saudis were playing him,” one former White House official said, speaking on condition of anonymity to discuss internal deliberations.

Few of the Saudi promises have amounted to much. 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.