Washington — In a rare concession, the Trump administration announced Monday it has agreed to extend work permits to tens of thousands of Salvadorans who have been working and living in the U.S. for years under an immigration protection the White House has sought to limit and end.

Under the agreement with the government of El Salvador, which comes after months of negotiations between both countries aimed at curbing the flow of Salvadoran migrants heading to the U.S.-Mexico border, the administration said it would allow more than 250,000 Salvadoran immigrants with Temporary Protected Status (TPS) to stay and legally work in the U.S. until January 2021.

Since President Trump took office, his administration has repeatedly tried to end most TPS designations, including the one for El Salvador, which was granted in 2001 after a pair of devastating earthquakes struck the small Central American nation. The protection, established by Congress in 1990, is designed to avoid returning immigrants to home countries plagued by war, recovering from natural disasters or dealing with an epidemic.

Get Breaking News Delivered to Your Inbox

The Department of Homeland Security, which administers the protection, had previously announced the eventual termination of TPS protections for more than 250,000 immigrants from El Salvador, Honduras, Sudan and Haiti, but litigation has prevented the administration from dismantling the programs. But for the court rulings, the termination of the TPS designation for El Salvador would've occurred last month.

On Monday, the U.S., in addition to extending their work authorization, also pledged to give TPS beneficiaries from El Salvador a year to return to their home country after the "conclusion" of litigation surrounding the administration's controversial decisions to terminate TPS program.

In this May 25, 2018 photo, Nilson Canenguez, left, who is on the Temporary Protected Status program, or TPS, hugs his daughter Maybelin as his wife Judit looks on at their home in Morningside, Maryland. Jacquelyn Martin / AP

The center-right Salvadoran government of President Nayib Bukele praised the agreement.

"The Salvadorans protected by the TPS are admirable people, who have worked for 20 years to build a future of well-being," El Salvador's foreign minister Alexandra Hill said in a statement. "Now, thanks to President Bukele, we can tell nearly 250,000 fellow citizens and their families that with the support of the United States they can continue to fight for their dreams. They are not alone."

Hill, who was in Washington on Monday to sign the agreements, said her government would continue to look for a "permanent solution" to the uncertain status of tens of thousands of its citizens in the U.S. Protections for them have been a priority for the Bukele government, which has vowed to foster more economic opportunity to discourage migration to the U.S.

President Trump meets with President Nayib Bukele of El Salvador during the United Nations General Assembly on Wednesday, September 25, 2019, in New York. Evan Vucci / AP

The deal on Monday comes weeks after both countries signed an agreement that, once implemented, will allow the U.S. to reroute certain asylum seekers to El Salvador if they traveled through there to reach the U.S.-Mexico border and did not seek protection there. The asylum accord is one of three agreements outgoing Acting Homeland Security Secretary Kevin McAleenan forged with all three countries in Central America's Northern Triangle, which includes Guatemala and Honduras.

"Today's agreements will significantly help the U.S. and our partners in El Salvador confront illegal migration and will strengthen the entire region as we approach the implementation of asylum cooperative agreements," McAleenan said in a statement.

In addition to the deal on TPS, the two countries signed two other agreements on Monday. Both sides agreed to the deployment of U.S. immigration authorities to El Salvador to assist officials there curb drug and human trafficking, as well as to sharing biometric data to combat crime.

In a press release, the Department of Homeland Security said it was still committed to ensuring that TPS beneficiaries return to El Salvador through an "orderly and responsible process." But the department suggested that an abrupt end to their protections might backfire.

"A sudden inflow of 250,000 individuals to El Salvador could spark another mass migration to the U.S. and reinvigorate the crisis at the southern border," the release said.