Shortly before a Supreme Court decision on Friday that handed President Donald Trump $2.5 billion in border wall funding, he received another big win for his immigration agenda: a treaty designating Guatemala as safe for asylum seekers.

On Friday afternoon, the US and Guatemala signed an agreement that will direct Central American migrants who pass through Guatemala hoping to seek asylum in the United States to first apply for protection in Guatemala instead. Those who travel to the US without applying for asylum in Guatemala could be removed by US border officials to that country.

According to a new rule implemented by the Trump administration earlier this month, people seeking asylum at the US border will be turned away if they passed through another safe country — a “safe third country,” as they are called — before reaching the United States.

The deal signed Friday by Guatemalan Interior Minister Enrique Degenhart and Trump, alongside acting Homeland Security Secretary Kevin McAleenan, technically designates Guatemala as such a safe third country.

Notably, it does not do so explicitly, likely due to Guatemalan controversies over third safe country deals and legal barriers to such an agreement erected by Guatemala’s court system. Nevertheless, the move is expected to curb migration from Guatemala, Honduras, and El Salvador, the Central American countries from which the bulk of asylum seekers at the US border originate.

The signing ceremony was announced on Twitter, taking politicians and immigration activists alike by surprise, according to the New York Times.

Today, President Trump announced a safe third country agreement with Guatemala that will put human smugglers out of business and provide safety for legitimate asylum seekers. pic.twitter.com/ENAifXfvRz — The White House (@WhiteHouse) July 26, 2019

The agreement comes after months of talks, a canceled visit to Washington from Guatemalan President Jimmy Morales, and threats from the Trump administration of tariffs if an agreement was not reached.

Trump celebrated the treaty as a victory on Friday, calling it a “landmark agreement” that will “put the coyotes and smugglers out of business.”

Morales was less optimistic, saying on social media on Friday that the deal will help Guatemala to escape “drastic sanctions.”

Many details of the agreement, which would last for two years, remain murky. It does not apply to “unaccompanied minors” — children who arrive alone to the border — or to Guatemalans seeking asylum, according to a Spanish-language version of the agreement released on Twitter. The White House has not yet released its own version of the agreement.

The deal faced fierce opposition in Guatemala, but tariff threats limited options

The new policy would, “with few exceptions, make it extraordinarily difficult for anyone not coming from Mexico or on a plane to be eligible for asylum in the US,” Vox’s Jen Kirby has reported. And it has been controversial since talks between the US and Guatemala began earlier this summer.

Human rights groups have pointed out that Guatemala has similar levels of gang-related violence as its neighbors; MS-13 and other gangs operate across all three countries. Migrants from these three countries have contributed to the spike in border crossings in the last year, with nearly 150,000 asylum-seeking families arriving from Guatemala since October 2018, according to US Customs and Border Protection figures.

By contrast, 262 people applied for asylum in Guatemala between January and November 2018, according to the United Nations refugee agency, UNHCR. A large increase in that number could strain local resources, refugee experts say.

“Guatemala is in no way safe for refugees and asylum seekers, and all the strong-arming in the world won’t make it so,” said Eric Schwartz, president of Refugees International, in a statement. “This agreement also violates US law and will put some of the most vulnerable people in Central America in grave danger.”

The prospect of such a treaty faced strong opposition from within Guatemala. The country’s highest court granted injunctions three times to stop its government from signing an agreement without congressional approval. Earlier this month, Morales, Guatemala’s president, postponed a scheduled visit to Washington amid the outcry.

“The government of the republic reiterates that at no point it considers signing an agreement to convert Guatemala into a safe third country,” the government said at the time.

Following that statement, Trump began to ramp up public threats of tariffs against the Central American nation, already one of the continent’s poorest countries. He also threatened to tax remittances — money that immigrants send home to family members — and to ban travel out of the country.

Guatemala, which has been forming Caravans and sending large numbers of people, some with criminal records, to the United States, has decided to break the deal they had with us on signing a necessary Safe Third Agreement. We were ready to go. Now we are looking at the “BAN,”.... — Donald J. Trump (@realDonaldTrump) July 23, 2019

....Tariffs, Remittance Fees, or all of the above. Guatemala has not been good. Big U.S. taxpayer dollars going to them was cut off by me 9 months ago. — Donald J. Trump (@realDonaldTrump) July 23, 2019

With the signing of the treaty, those threats are, for now, off the table. Part of the agreement also will increase access to temporary worker visas, known as H-2A visas, for Guatemalan farmworkers.

The pressure on Guatemala stems in part from the recent US-Mexico deal that sent 6,000 members of Mexico’s National Guard to that country’s southern border, shared with Guatemala. That deal, too, resulted in part from a threat of high tariffs on Mexican imports. According to Reuters, Marcelo Ebrard, Mexico’s foreign minister, called on other countries, including neighboring Guatemala, to do their part following Mexico entering that agreement.

”They’re doing what we’ve asked them to do. I think it’s going to be a great thing for Guatemala,” Trump said during the signing ceremony. “They don’t want the problems either.”

Questions remain about how this latest policy will be implemented. For one thing, the Guatemalan high court’s injunctions still stand. And given the low number of asylum cases the country has historically heard, there is little infrastructure in place to receive anywhere near the number of migrants that have reached the US-Mexico border in recent months.

McAleenan, the acting homeland security secretary, said he thinks that the agreement will be ratified and recognized within the next several weeks. But according to ABC News, neither he nor the Spanish-language statement from Guatemala refer to the deal as binding.

Such confusion could harm migrants, suggests the statement from Refugees International.

“At the moment, it is not clear exactly what arrangement has been reached in light of the Guatemalan Constitutional Court’s provisional decision against a third country agreement,” Schwartz went on to say. “But the president’s statements on this are of the deepest concern. Such an arrangement would make a mockery of the notion that those fleeing persecution in Central America have any recourse.”

And should passing through Guatemala lead to rejection in the US, asylum seekers may be tempted to find other, potentially more dangerous routes north. Water routes that bypass Guatemala for countries without asylum arrangements with the US could be established, for instance, with boats traveling from northern Honduras to Belize, or even straight to Mexico.

Although the deal’s been signed, it may not be implemented

With US activists and Democratic politicians decrying the deal, lawsuits are expected to follow. Rep. Eliot Engel, D-NY, chair of the House Foreign Affairs Committee, called the agreement “illegal.”

“Simply put, Guatemala is not a safe country for refugees and asylum seekers, as the law requires,” he said.

And lawyers from the ACLU, which has been involved in a number of lawsuits challenging US attempts to limit asylum claims, agreed.

“Guatemala can neither offer a safe nor fair and full process, and nobody could plausibly argue otherwise,” the ACLU’s Lee Gelernt told the New York Times. “There’s no way they have the capacity to provide a full and fair procedure, much less a safe one.”

Guatemalan politicians will also be left to navigate their own court challenges. Because the agreement is not officially called a “safe third country” agreement, Morales may have hoped to skirt the letter, if not the spirit, of the court’s injunctions. However, it is not clear whether his administration — and the agreement — will be protected by these sort of semantics.

Adding to the tumult, Guatemala is in the midst of a presidential election. The next leg will take place on August 11, and term-limited Morales will leave office in January. Both candidates running to replace Morales have criticized the deal; one called the agreement “irresponsible” and the other has strongly opposed signing any sort of safe third country agreement for months.

Whoever wins will be tasked with defending the deal in Guatemala’s courts, and well as figuring out how to implement it. If they don't scrap it completely, that is.