WASHINGTON – The five U.S. attorneys along the border with Mexico, including three appointed by President Donald Trump, recoiled in May 2018 against an order to prosecute all immigrants who entered the U.S. illegally, even if it meant separating children from their parents. They told top Justice Department officials they were “deeply concerned” about the children’s welfare.

But the attorney general at the time, Jeff Sessions, made it clear what Trump wanted on a conference call later that afternoon, according to a two-year inquiry by the Justice Department’s inspector general into Trump’s “zero tolerance” family separation policy.

“We need to take away children,” Sessions told the prosecutors, according to participants’ notes. One added in shorthand: “If care about kids, don’t bring them in. Won’t give amnesty to people with kids.”

Rod Rosenstein, then the deputy attorney general, went even further in a second call about a week later, telling the five prosecutors that it did not matter how young the children were. He said that government lawyers should not have refused to prosecute two cases simply because the children were barely more than infants.

“Those two cases should not have been declined,” John Bash, the departing U.S. attorney in western Texas, wrote to his staff immediately after the call. Rosenstein “instructed that, per the AG’s policy, we should NOT be categorically declining immigration prosecutions of adults in family units because of the age of a child.”

The Justice Department’s top officials were “a driving force” behind the policy that spurred the separation of thousands of families, many of them fleeing violence in Central America and seeking asylum in the United States, before Trump abandoned it amid global outrage, according to a draft report of the results of the investigation by Michael E. Horowitz, the department’s inspector general.

The separation of migrant children from their parents, sometimes for months, was at the heart of the Trump administration’s assault on immigration. But the fierce backlash when the administration struggled to reunite the children turned it into one of the biggest policy debacles of the president’s term.

Though Sessions sought to distance himself from the policy, allowing Trump and Homeland Security Department officials to largely be blamed, he and other top law enforcement officials understood that “zero tolerance” meant that migrant families would be separated and wanted that to happen because they believed it would deter future illegal immigration, Horowitz wrote.

“The department’s single-minded focus on increasing prosecutions came at the expense of careful and effective implementation of the policy, especially with regard to prosecution of family-unit adults and the resulting child separations,” the draft report said.

The draft report, citing more than 45 interviews with key officials, e-mails and other documents, provides the most complete look at the discussions inside the Justice Department as the family separation policy was developed, pushed and ultimately carried out with little concern for children.

This article is based on a review of the 86-page draft report and interviews with three government officials who read it in recent months and described its conclusions and many of the details in it. The officials, who spoke on the condition of anonymity, cautioned that the final report could change.

Horowitz had been preparing to release his report since late summer, according to a person familiar with the investigation, though the process allowing for responses from current and former department officials whose conduct is under scrutiny is likely to delay its release until after the presidential election.