The Trump administration put "electoral calculations" over national security and immigrants' safety when it pushed to end a longstanding program protecting hundreds of thousands of immigrants despite warnings from career diplomats and State Department officials, according to an investigation commissioned by Senate Democrats.

The administration ignored recommendations to phase out the Temporary Protected Status program, or TPS, in a few years and instead decided to accelerate immigrants' departures so they wouldn't be taking place around the 2020 re-election campaign, according to memos.

Sen. Bob Menendez, D-N.J., the top Democrat on the Senate Foreign Relations Committee, sought the investigation to examine the role of the State Department in the Trump administration’s decision to terminate TPS for people born in El Salvador, Honduras and Haiti.

TPS allows immigrants in the country, including those who arrived or stayed illegally, to remain and work in the U.S. if their home countries are experiencing catastrophic events such as natural disasters or wars. Currently, 400,000 people have TPS.

Sen. Bob Menendez arrives for the Senate Foreign Relations Committee hearing on June 20, 2019. Bill Clark / CQ-Roll Call via Getty Images file

For almost 20 years, previous administrations from both parties have renewed the TPS status of hundreds of thousands of people, until the Trump administration took over and ended the program in November 2017, though courts have temporarily blocked the administration from doing so.

According to the report, dozens of internal State Department memos and diplomatic communications obtained by the Democrats' investigators show that senior officials repeatedly warned former Secretary of State Rex Tillerson that eliminating TPS for those immigrants would seriously destabilize the three countries and bring "negative consequences for U.S. national security" by triggering "increased irregular migration."

The officials advised Tillerson to phase out temporary protections for Salvadoran, Honduran and Haitian immigrants over a period of three years, according to the report on the investigation.

Instead, Tillerson and staff from his Office of Policy Planning advocated for a rapid TPS termination because the timeline that senior officials were recommending would mean the protected status would end for thousands of people "directly in the middle of the 2020 election cycle,’’ according to an Oct. 26, 2017, memorandum referenced in the report.

BREAKING: Released new report with 140 pages of State Dept docs detailing how the Trump Admin played politics with #TPS. https://t.co/4otATGZFI9 — Senator Bob Menendez (@SenatorMenendez) November 7, 2019

"In making such an overt reference to the 2020 presidential race, senior Trump administration appointees reporting directly to the Secretary of State revealed that their recommendation to end TPS more quickly was based on political, not policy reasons," investigators concluded in the report. "This recommendation effectively prioritized electoral calculations over considerations of U.S. national security, not to mention the personal safety of nearly 400,000 TPS recipients and their estimated 273,000 American children."

Menendez said in a statement that such findings are part of a pattern "we have become all too familiar with." The senator sent a letter to the State Department inspector general asking for an investigation.

Tom Jawetz, vice president of immigration policy at the Center for American Progress, said in a press conference Thursday that "the administration was willing to play political games with our national security and the safety of TPS recipients and their American children.”

Jawetz added that the evidence also suggests that Trump and his administration violated the Administrative Procedure Act and the Immigration Nationality Act.

A spokesperson from the State Department told NBC News that the agency has not commented on the investigation since it was made public Thursday.

Return to deadly violence?

Senior diplomats have repeatedly cautioned that TPS holders from El Salvador and Honduras would face alarming levels of criminal violence and unstable social conditions in their countries of origin if they are forced to return.

Honduras is among the countries with the world's highest rates of murder, violence and corruption, according to Human Rights Watch.

The murder rates in both Honduras and El Salvador are three to eight times more than what the World Health Organization considers to be epidemic levels.

The WHO considers a rate of 10 murders per 100,000 inhabitants to be an epidemic level. In 2016, El Salvador saw a murder rate of 81 per 100,000 inhabitants. In Honduras, it was 59 per 100,000, according to Amnesty International.

Officials have pointed out that an estimated 273,200 children, who are U.S. citizens, would be exposed to epidemic levels of violence if they go to their parents' home countries and be more vulnerable to recruitment by gangs like MS-13.

Over the years, rampant crime and gang activity have fueled large immigration waves to the U.S. Many Hondurans and Salvadorans living in the U.S. have fled gang violence perpetrated by MS-13, Barrio 18 and other gangs, as their networks and drug traffickers have expanded their hold in Central America.

Due to these risks, parents with TPS may end up leaving their children in the U.S. if they were deported.

In Haiti, fuel shortages, spiraling inflation, environmental degradation and the lack of safe drinking water and food have pushed tens of thousands of Haitians to the streets, leading to deadly protests.

Follow NBC Latino on Facebook, Twitter and Instagram.