On Sunday afternoon, the Guatemalan government issued a statement cancelling a highly anticipated meeting, scheduled for Monday, in Washington, between Jimmy Morales, the President of Guatemala, and Donald Trump. The subject of the meeting was a deal between the two countries that would allow the U.S. government to begin sending asylum seekers to Guatemala under the terms of a so-called safe-third-country agreement. The idea was to outsource part of the American asylum system to Guatemala, despite the fact that many of the Central-American asylum seekers arriving at the U.S. border are Guatemalans fleeing poverty, hunger, and violence in their home country. “Opposition to the deal was widespread in Guatemala,” Lucrecia Hernández Mack, a newly elected member of the Guatemalan congress, told me. “Morales was acting alone.” Over the weekend, the country’s Constitutional Court was considering three separate petitions filed in an attempt to block the deal; on Sunday night, a few hours after Morales cancelled his plans for Washington, citing the pending legal case, the judges issued their ruling: Morales was forbidden from negotiating the deal on his own, without consulting the Guatemalan congress. According to a member of the Trump Administration, “if the injunctions didn’t happen in Guatemala, then the deal would have been signed on Monday.”

Reports about a possible agreement between the two countries have been circulating for more than a month, but some of the concrete details of what the arrangement would actually look like emerged late last week. The New Yorker obtained a draft of the agreement, which stated that the U.S. would be able to send asylum seekers from any country to Guatemala, including, in theory, those who never even travelled through Guatemala in the first place. As such, the over-all agreement seemed to go even further than a traditional safe-third-country agreement. According to a person with knowledge of the deal, there were additional stipulations in a second document, called the “implementation plan,” which made clear that the Trump Administration intended the agreement to apply primarily to asylum seekers from Honduras and El Salvador. Still, at an earlier stage of deliberations over the policy, there had been a discussion inside the Trump Administration about taking advantage of the agreement’s broad language to send more people to Guatemala. Ultimately, that position was considered too extreme, though the language of the agreement itself, which allowed for that possibility, remained intact.

“The Guatemalans did not know what they were getting into,” the Trump Administration official told me. “To this day, Morales believes this agreement is not a safe-third. They don’t want anyone to call it that.” One reason for Morales’s confusion seems to be that there were no real examples of an analogous deal for him to use as a point of reference. The U.S. does have a safe-third-country agreement with Canada—if asylum seekers arrive at a Canadian port of entry, immigration authorities will send them back to the U.S., on the grounds that they could receive a fair hearing in the American system, and vice versa—but it’s different from anything under consideration at the southern border. For one thing, the number of asylum seekers from Central America is significantly higher there, and has been on the rise. There are also serious concerns about whether Guatemala could provide a safe and stable environment in which Hondurans, Salvadorans, or anyone else travelling through the country could actually seek asylum. Manfredo Marroquín, a Guatemalan human-rights advocate and recent Presidential contender, who filed one of the three petitions to the Constitutional Court, told me, “Signing this agreement would be putting at risk the constitutional rights of Guatemalans, because the government would be forced to give to others what it hasn’t given to Guatemalans—safety, employment, health care, and education.”

Part of Morales’s considerations related to Mexico, Guatemala’s northern neighbor, which is also in the midst of tense negotiations with the Trump Administration over a safe-third-country deal, according to the person with knowledge of the negotiations. Although the government of Andrés Manuel López Obrador has publicly opposed such an agreement, it conceded last month, under pressure from Trump, that the option was on the table. “The Guatemalans likely thought that partnering with the U.S. on this would help them highlight how Mexico isn’t doing enough,” the Administration official told me. “Mexico has been against signing this kind of agreement, which the Guatemalan government knows. The Guatemalans wanted to not be seen as the problem.”

A Presidential runoff in Guatemala will be held in August, and Morales has six months left in office; pursuing the deal, Jordán Rodas, Guatemala’s human-rights ombudsman, told me, “was yet another way he was trying to ingratiate himself with the Trump Administration” before the end of his term. Sunday’s court ruling in Guatemala has effectively ended speculation about the viability of a deal between the two countries. Because Morales lacks support in congress to pursue the agreement, and the Constitutional Court has barred him from acting alone, it isn’t clear what the President could do to revive the talks with Washington. “Morales wanted to end his time as close as he could to the U.S.,” the person familiar with the negotiations told me. Rodas, who also filed one of the court petitions, told me, “We cannot trust that this government won’t try this again, but it’ll be very hard now. It was very important that, once again, the Constitutional Court has asserted the rule of law.” (On Twitter, Francisco Villagran de Leon, a former Guatemalan Ambassador to the U.S. who is a visiting scholar at George Washington University, said, “It wasn’t Jimmy Morales who canceled the meeting. It was Trump. Jimmy didn’t want to miss an opportunity to go to the White House, but they told him not to go. They didn’t want to expose Trump to the fiasco of signing something that the Constitutional Court in Guatemala could have disallowed.”)

On Monday morning, the Trump Administration revealed that it had also, simultaneously, been planning a sweeping new regulation to limit asylum at the southern border. Announced by the Justice Department and the Department of Homeland Security, the regulation, which will almost certainly be challenged in U.S. federal court, states that a person cannot qualify for asylum in the U.S. if she failed to apply for asylum in a third country through which she travelled on her way to the U.S. “In one line, it’s really ending the ability of Central Americans to apply for asylum at the southern border,” Sarah Pierce, a lawyer with the Migration Policy Institute, told me. “As a result of this move, we would be deporting people who qualify for asylum in the U.S. back to the countries from which they fled.”