It was Friday night last week and top officials in Mexico, including those in the president and foreign minister’s offices, were alerted by their aides that Donald Trump had tweeted, again.

Officials and aides had all grown accustomed to following President Trump’s personal Twitter account throughout the ongoing immigration talks.

Most times they ignored the missives, believing that Trump’s public statements were often divorced from the reality of the negotiations, according to individuals with direct knowledge of that strategy. Instead, they relied on what Mexican officials viewed as a better source of information from inside the Trump administration: Jared Kushner, the president’s son-in-law and top adviser.

According to individuals working with the Mexican government, Kushner served as both a source of comfort and a backchannel during a months-long process that was filled with threats of devastating tariffs and accusations that the country wasn’t doing enough to stem the tide of immigration to the U.S’s southern border.

Tapping on Kushner for clarity has become a semi-official policy in the top ranks of the offices of President Andrés Manuel López Obrador and Foreign Minister Marcelo Ebrard, those same sources same. One person familiar with the bilateral interactions said that senior Mexican officials had sought aggressively to cultivate Kushner as a primary contact and possible “good cop” since at least early 2017.

“The idea was always that Trump is an emperor that thinks he has clothes on but really doesn’t,” one source who directly communicates with the presidential palace in Mexico told The Daily Beast. “I think they’ve found that they can come to rely on Jared. The question is whether what they relay to him is making its way to Trump.”

Representatives from the Mexican government did not respond to requests for comment as of press time. Neither did White House spokespeople.

That Mexico turned to Kushner when dealing with threats from Trump may seem like an unorthodox form of diplomatic maneuvering. But it also reflects the insular structure of Trump’s foreign policy apparatus, in which seasoned officials have seen their influence diminished by the president’s son-in-law and others inside the West Wing.

Kushner had met with Mexican officials about the situation on the southern border several times over the last few years. And in November the Mexican government awarded him one of the country’s highest honors—the Order of the Aztec Eagle—for his "significant contributions in achieving the renegotiation of the new agreement between Mexico, the United States and Canada."

Although Mexican officials often communicate with their counterparts in the Trump administration—including those at the Department of Homeland Security as recently as last week—Trump’s son-in-law and senior adviser has proved to be the fastest way to get their questions answered, sources said.

“The close working relationship between the Trump administration and the Mexican government actually predates President Trump’s 2016 election, and it was initially spearheaded by Jared Kushner’s contacts within the Mexican government at the time,” recalled Jason Miller, Trump’s 2016 senior comms adviser. Miller added that it was “because of Jared’s relationships… that then-candidate Trump was able to make his trip to Mexico during the campaign.”

The line of communication has become increasingly useful to Mexico over the last six months. Two senior Trump administration officials told The Daily Beast that Mexican officials made Kushner their “main point person”—as one of the officials described him—in their behind-the-scenes attempts to wave the president off his strategy of weaponizing tariffs in order to get Mexico to crack down on the flow of migrants through their borders. Among the arguments they pushed to Kushner, these sources noted, was that the tariffs would backfire, bringing economic suffering not only to Mexicans but U.S. citizens as well.

That effort failed to make a dent late last month, when President Trump escalated his tariff threats against Mexico. The move caused grief for many Republicans on Capitol Hill and officials in the Department of Homeland Security. But it came to the delight of immigration and trade hardliners in the president’s inner circle, such as Trump’s senior policy adviser Stephen Miller.

“The problem is people in other federal agencies, like DHS, have worked really hard to get a deal negotiated with Mexico,” said John Cohen, the former deputy undersecretary for intelligence and analysis at DHS. “But you have people working in the White House, that have the president’s ear, that aren’t versed in immigration policy. And conditions at the southern border have deteriorated as a result of the administration’s misguided approach.”

Despite their strategy of ignoring Trump, Mexican officials did pay particular attention one 280-character declaration late last week. On Friday, Trump seemed to announce on Twitter that there had been an unprecedented breakthrough between the U.S. and Mexico.

The two countries had indeed reached a deal but much of the agreement had been hashed out months earlier, according to the New York Times— a fact confirmed by senior Mexican officials who spoke with The Daily Beast.

Things became even more confusing for Mexico on Saturday when Trump claimed there were secret provisions to the deal, in particular related to agriculture. Two individuals involved in the negotiation process between the U.S. and Mexico said they were not aware of any secret provisions.

In a press gaggle Tuesday, Trump waved a piece of paper in front of the press corps, claiming it was his deal with Mexico. But he did not reveal the contents of the paper.