For the past year, the Trump administration has been phasing out a special immigration program that has allowed hundreds of thousands of foreigners from nations devastated by natural disasters and civil strife to live and work in the U.S. as legal residents.

In order to do so, the Department of Homeland Security has tossed aside findings reached by Republican and Democratic administrations over nearly three decades and adopted a new, more narrow interpretation of U.S. law.

The result could be the removal – sometimes willingly, sometimes forced – of 98 percent of the 317,000 foreigners in the Temporary Protected Status (TPS) program. It remains unclear what will happen to the 230,000 children they’ve had while in the U.S., all citizens by birth. A federal judge this month has put a temporary stop to the administration’s plans pending an appeal by the Department of Justice, but most TPS holders still remain uncertain as to whether they will be allowed to remain in the U.S.

Homeland Security Secretary Kirstjen Nielsen says the administration has simply been following the letter of the law in ending TPS status for six of those countries: El Salvador, Haiti, Honduras, Nicaragua, Nepal and Sudan.

John Feeley, a former ambassador to Panama who resigned earlier this year in protest of President Donald Trump's actions toward immigrants, said that cold calculus ignores the real-life implications of the policy change.

"With the rise in criminality and the weakness in the rule of law in these countries, sending those people back...is like throwing red meat to the wolves," Feeley said. "By having somebody legally in the United States, registered, not breaking the law, working, and then all of a sudden to change that is not a technicality of law, it's a betrayal of values and the Good Housekeeping seal of approval of American integrity."

The Immigration and Nationality Act of 1990 allows the government to grant TPS to a country that has been hit by an armed conflict, natural disaster, medical epidemic, or other "extraordinary" conditions. The status can only be granted for up to 18 months, but can be repeatedly extended if the conditions persist.

That's exactly what the administrations of former presidents George H.W. Bush, Bill Clinton, George W. Bush, and Barack Obama did for most TPS countries, arguing that conditions hadn't improved enough in each country to end the program.

For example, Honduras was first granted TPS after Hurricane Mitch devastated the nation in 1998, and multiple administrations extended those protections so long as the country remained in recovery mode or faced new hardships. In 2006, the George W. Bush administration extended TPS partly because Hurricane Beta displaced 11,000 people and destroyed bridges, roads and crops.

Shortly after President Donald Trump moved into the White House, everything changed. U.S. law states that TPS shall be terminated if a country no longer meets the original conditions for TPS. Homeland Security says that means subsequent disasters don’t count.

"The Secretary determined that the disruption of living conditions in Honduras from Hurricane Mitch that served as the basis for its TPS designation has decreased to a degree that it should no longer be regarded as substantial," read a Homeland Security announcement in May ending TPS for Hondurans. “Thus, as required under the applicable statute, the current TPS designation must be terminated.”

More:Thousands of legal immigrants face daunting decision after their ‘Temporary Protected Status’ ends

More:The six countries 300,000 immigrants must return to with end of TPS program

Feeley, immigration advocates and a bipartisan group of legislators all disagree, arguing that the administration will be sending those TPS holders into the middle of deadly protests, armed conflicts, raging gang violence, food shortages, and ongoing reconstruction efforts that are years from completion.

Sen. Marco Rubio, R-Fla., even penned an op-ed in the Miami Herald last year urging the administration to extend TPS protections for Haitians. That country was initially granted TPS status after the 2010 earthquake, but Rubio wrote that the island's "perilous conditions" have continued due to a deadly cholera epidemic and a direct hit from Hurricane Matthew in 2016.

"Haitians sent home will face dire conditions, including lack of housing, inadequate health services and low prospects for employment," Rubio wrote. "Failure to renew the TPS designation will weaken Haiti’s economy and impede its ability to recover completely and improve its security."

Sen. Bill Nelson, D-Fla., has echoed Rubio’s arguments in lobbying the administration for extending TPS for Haitians and other immigrant groups. Senators from both major parties in other states with large numbers of TPS holders have repeatedly called for not ending the program.

Some officials within Homeland Security believe the administration didn’t reach honest conclusions when it declared each TPS country sufficiently recovered from their original disasters. In one email exchange, an official complained that the summary of conditions in three countries are too negative, requesting more examples of “positive steps” taken since the country was first granted TPS.

Another official responded: "The basic problem is that it IS that bad."