The Trump administration has reached a deal with El Salvador that will see the Central American nation offer refuge to asylum seekers traveling to the U.S.

An unidentified Trump official told the Associated Press that Acting Homeland Security Secretary Kevin McAleenan reached the agreement with El Salvador and was expected to sign it Friday afternoon. Details were said to be worked out in coming months.

The deal requires El Salvador to offer refuge for asylum seekers denied entry by the U.S., the second such deal the administration has reached. A deal to curb immigration to the U.S. was worked out with Guatemala in July, requiring immigrants passing through that country to seek asylum there first. If Guatemala denies asylum, migrants then would be allowed to seek U.S. entry.

These deals have been criticized harshly by opponents of Trump’s hardline stance on immigration, saying they outsource Washington's responsibility to provide aid for those seeking asylum.

The so-called Northern Triangle -- Honduras, El Salavador and Guatemala -- is considered one of the most dangerous regions in the Western Hemisphere, with high levels of gang violence and murder. MS-13 and Barrio 18 have been fighting a gang war in El Salvador, making that countrty a hotbed of rape, murder, arms dealing and human trafficking.

“Let's have a legitimate process for resolving asylum claims, not turn everybody down right away, not make them wait for years until they can get a claim, not try to lie and say 'well you can go to Guatemala, that's a safe nation,' when it's got one of the highest homicide rates in the world,” Sen. Tim Kaine, D-Va., said during a July interview with CBS.

U.S. Border Patrol agents are pictured detaining undocumented immigrants after they crossed the border from Mexico into the United States on Aug. 7, 2015 in McAllen, Texas. John Moore/Getty Images