Washington (CNN) There was a simple explanation in October 2017 when a Department of Homeland Security official was asked why a memo justifying ending immigrant protections for Central Americans made conditions in those countries sound so bad.

"The basic problem is that it IS bad there," the official wrote.

Nevertheless, he agreed to go back and see what he could do to better bolster the administration's decision to end the protections regardless.

The revelation comes in a collection of internal emails and documents made public Friday as part of an ongoing lawsuit over the decision to end temporary protected status for hundreds of thousands of immigrants who live in the US, most of whom have been here for well over a decade.

Friday's document dump come as backup for the attorneys' request that the judge immediately block the government's decision to end these protections as the case is fully heard. A hearing is scheduled for late September.

In the emails, Trump administration political officials repeatedly pushed for the termination of TPS for vulnerable countries, even as they faced pushback from internal assessments by career staffers and other parts of the administration.

In one exchange , the now-director of US Citizenship and Immigration Services, Francis Cissna, remarks that a document recommending that TPS for Sudan be terminated reads like it was going to recommend the opposite until someone was "clubbed ... over the head."

"The memo reads like one person who strongly supports extending TPS for Sudan wrote everything up to the recommendation section and then someone who opposes extension snuck up behind the first guy, clubbed him over the head, pushed his senseless body of out of the way, and finished the memo. Am I missing something?" he wrote to key DHS staffers. Another high-ranking official then asks for the memo to be "revised."

In a similar exchange , policy adviser Kathy Nuebel Kovarik asks her staff to address what she perceives as inconsistencies in the justification documents for ending TPS for El Salvador, Honduras and Nicaragua.

"The problem is that it reads as though we'd recommend an extension b/c we talk so much about how bad it is, but there's not enough in there about positive steps that have been taken since its designation," she wrote.

Staffer Brandon Prelogar responded that "it IS bad there."

"We can comb through the country conditions to try to see what else there might be, but the basic problem is that it IS bad there (with regards to) all of the standard metrics," Prelogar wrote. "Our strongest argument for termination, we thought, is just that it is not bad in a way clearly linked to the initial disasters prompting the designations. We can work with RU to try to get more, and/or comb through the country conditions we have again looking for positive gems, but the conditions are what they are."

DHS did end protections for all three countries, despite dire predictions previously reported by CNN from career analysts about the consequences including potentially strengthening the vicious gang MS-13.

Immigrants are suing over the ending of TPS for these countries, alleging the protections were terminated due to a prebaked agenda that violated the law, as well as a racist agenda. The judge has previously allowed the lawsuit to proceed and forced the production of these internal documents, over the objection of the government.

The program covers migrants in the US from countries that have been hit by dire conditions, such as epidemics, civil war or natural disasters. Previous administrations, spanning both parties, had opted to extend the protections for most of the countries involved every few years when they came up for review.

The Trump administration says the conditions in each country have improved from the original disasters to the point that the protected status had to end. DHS has maintained that under its reading of the law, decisions to extend may be based only on conditions from the original disaster -- not any that have arisen since. That breaks with the reading of the law from all prior administrations, attorneys argue -- citing a deposition of a former USCIS director also submitted Friday.

The documents show a gradual process of the front offices of DHS taking more control of the TPS decision making. Early in the administration, career staffers drafted a document that would have justified extending TPS for Haiti. Officials asked that it be changed, and it was initially extended just six months ahead of being terminated completely.

For later decisions, the documents show the State Department complaining that it was marginalized from the process. In fact, a Federal Register Notice for the termination for Sudan had to be pulled back and edited after the State Department complained that it had been changed from a version it had approved at the last minute to something inconsistent with current US policy toward the country.

The emails show that Gene Hamilton, a close ally of Attorney General Jeff Sessions who was a senior counselor at DHS before moving to the Justice Department, made some of those last-minute revisions, attempting to remove references to human rights violations, among other changes.

When presented with Hamilton's changes to some language already agreed to with the State Department, Prelogar wrote that "we'd just say that this could be read as taking another step toward providing an incomplete and lopsided country conditions presentation to support termination, which may increase the likelihood of criticism from external stakeholders to that effect."

The trail also shows the State Department had recommended TPS for Sudan be extended , although it did so late in the game, and that it was caught off-guard by the changes.

In a last-minute email , the State Department's Christopher Ashe wrote to the acting director of USCIS that there were problems.

"The Department has identified some significant mischaracterizations that are at odds with the Department's understanding of circumstances on the ground. We believe that lacking correction, the (Federal Register Notice) could be out of step with the Administration's broader engagement on Sudan -- much of which DHS is not engaged on and is likely unaware of the nuances that USCIS's changes in the language could have," Ashe wrote.

He continued that State was "caught off guard" by a decision to make the announcement.

"We literally were forced to dispatch our Foreign Affairs Officers by taxi to the Embassies with virtually no notice to inform the host governments of the imminent announcements. We had thought we had obtained a commitment for sufficient notice to make such notifications," Ashe wrote.

Nuebel Kovarik responds on the email chain that DHS would reject the suggested change by State that would imply not "all" nationals of Sudan could return, saying it would contradict the decision to terminate. She agrees to change the notice to acknowledge that some regions of Sudan may remain too dangerous for return.

State had asked for that, noting that otherwise it could "encourage the Government of Sudan to believe they have the greenlight from US (government) to force the return of displaced persons ... to return to deadly conflict-affected areas. These areas are places where even well-armed UN peacekeeping forces decline to engage for fear of violence and recent killings of peacekeepers."

But Nuebel Kovarik declines to hold off publishing the official announcement to accommodate the change, saying it's "minor" enough to be done later on as a revision.

"We don't say the country is perfect," she concluded.