MIAMI (AP) — As the Trump administration in its early days tried to push through hardline immigration policies, it appeared to calculate their possible impact on the 2020 presidential race while rejecting national security warnings from U.S. diplomats, according to State Department memos made public Thursday.

The internal documents, released in a report by Senate Democrats, offer a rare glimpse into the divide between career diplomats and a new administration eager to end a program protecting nearly 400,000 migrants from Central America and Haiti who had been living and working legally in the U.S.

Facing legal challenges, the Trump administration has since backed down and last month extended for a year the so-called temporary protected status, or TPS, for the migrants as U.S. courts work through the disputes.

The apparent injection of electoral politics in what was supposed to be a policy decision about humanitarian protections for migrants from some of the Western Hemisphere's poorest and most violent countries came from then-Secretary of State Rex Tillerson's policy planning staff, comprised of political appointees.

It contrasts with decades of bipartisan consensus on the issue as well as the pleas of U.S. Embassies in El Salvador, Honduras and Haiti that ending TPS would fuel a rise in transnational crime and illegal migration as well as damage the U.S.' standing in Latin America and the Caribbean.

"A sudden termination of TPS for El Salvador would undermine additional cooperation to tackle the root causes of illegal migration and overwhelm the country's ability to absorb the refugees," then-U.S. Ambassador Jean Elizabeth Manes wrote in a July 2017 cable to Washington, one of several recommendations received that summer from veteran diplomats who strenuously objected to the decision.

They were backed by the State Department's most-senior career diplomat at the time, then-Under Secretary of State for Political Affairs Thomas Shannon Shannon, who was even more unequivocal.

"It is our purpose to provide the best possible foreign policy and diplomatic advice," Shannon wrote in a private letter to Tillerson, cited in the report by the minority staff of the Senate Foreign Relations Committee. "From my point of view that advice is obvious: extend TPS for the countries indicated."

The arguments appear to have fallen on deaf ears. In the ensuing weeks, the Trump administration announced it was terminating the program for the three countries, giving migrants, some of whom had lived in the U.S. for two decades, 18 months to leave. The decision threatens to trigger an unprecedented wave of family separations as parents being expelled would be forced to choose between leaving behind their estimated 273,000 American children or exposing them to recruitment by powerful criminal gangs like El Salvador's MS-13.

"Today's report documents something we have become all too familiar with: the Trump Administration has repeatedly sought to use foreign policy not to further U.S. interests but the President's political aims," Sen. Bob Menendez, the ranking member of the Foreign Relations Committee, said at a press conference to present the report, which is titled "Playing Politics With Humanitarian Protections: How Political Aims Trumped U.S. National Security and the Safety of TPS Recipients."

Menendez on Thursday also sent a letter to the State Department's Inspector General asking him to investigate the extent to which electoral considerations played a role in terminating the TPS programs. Tillerson's policy staff of political appointees was at the time headed by Brian Hook, who is now the U.S. special envoy for Iran.

The State Department had no immediate comment on the report.

TPS was initially meant to aid people from countries facing wars or natural disasters. Citizens of Honduras were originally granted TPS in 1999 in the wake of overwhelming damage from Hurricane Mitch, while migrants from El Salvador and Haiti gained protection in 2001 and 2010 respectively following devastating earthquakes.

Since then, migrants from all three countries have seen those protections extended multiple times as successive U.S. administrations, Republican and Democrat, have acknowledged the difficulty the politically and economically fragile countries would face reabsorbing such a large number of returnees.

Similar arguments are reflected in a lengthy "action memo" with a menu of options sent to Tillerson on Oct. 26, 2017.

In it, Simon Henshaw, then acting head of the State Department's humanitarian bureau and now ambassador to Guinea, recommends extending TPS for all three countries. But he's outmaneuvered by Francisco Palmieri, the then top acting diplomat in Latin America, who recommends the programs be terminated over three years.

Tillerson's staff of political appointees endorses Palmieri's recommendation but push for termination within two years, pointing out that a 36-month deadline would fall "directly in the middle of the 2020 election cycle."

No further mention of the election is made, and it's not clear why exactly Tillerson's policy staff made mention of the race.

In the end, Tillerson was more eager, and with the stroke of a black pen scribbled "18 months" in three sections of the memo.

___

Follow Goodman on Twitter: https://twitter.com/APjoshgoodman

Copyright 2019 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.