Federal prosecutors in 2018 wanted to criminally charge Walmart over the company's opioid sales, but top Trump administration law enforcement officials killed that effort, a bombshell report says.

In a ProPublica article published Wednesday, the investigative journalism outlet reported that prosecutors from the federal Eastern District of Texas over two years had amassed "highly damning evidence" that the world's biggest retailer had filled opioid prescriptions for customers who then died of overdoses — over pharmacists' objections.

Pharmacists working in the state sounded the alarm to Walmart's corporate office, noting that many of the prescriptions were coming from doctors who were running "pill mills," the report said.

But Trump appointees at the Department of Justice squashed the case, the article reports.

Investigators obtained records that showed pharmacists working in Walmarts in other states, including Maine, North Carolina, Kansas and Washington, also voiced concern, citing "hundreds of thousands of suspicious or inappropriate opioid prescriptions," ProPublica reported.

But Walmart, upon learning of those issues, did not stem its opioid distribution. Instead, an opioid compliance manager in an email obtained by investigators said the company should focus on "driving sales," according to ProPublica.

But Walmart at this point had escalated its concerns about the case to the Justice Department, and the investigators were told to stand down, ProPublica's report said.

On Aug. 31, 2018, Walmart received a letter saying that the Justice Department would not prosecute, according to ProPublica, citing a letter from Walmart's lawyer that lays out the chronology of the case.

Prosecutors tried to save their case, meeting in October 2018 with Uttam Dhillon, acting administrator of the Drug Enforcement Administration, who was floored by the case, the news site reported.

"Jesus Christ," Dhillon, a Trump administration official, reportedly said to prosecutors, including Joe Brown, the U.S. attorney for the Eastern District of Texas, and Heather Rattan, known for prosecuting members of drug cartels. "Why aren't we talking about this as a criminal case?"

The prosecutors then obtained a meeting with the Justice Department, including then-U.S. Deputy Attorney General Rod Rosenstein, and laid out their evidence against the retailer.

Walmart, with 4,756 stores in the United States, poses significant danger to the country, those prosecutors argued, noting that it was a repeat offender, having agreed to a settlement with the DEA seven years earlier in which it had promised to improve its controls over the abuse of opioid prescriptions, according to ProPublica.

Prosecutors now believed they needed to pursue the "extraordinary path of a criminal prosecution," ProPublica reported. Dhillon emphasized at that meeting that Walmart had broken the law and suggested a fine wouldn't harm the company since it "has more money than it knows what to do with," according to the article.

"Not that there's anything wrong with that," Rosenstein responded, according to the report. "We are all capitalists here."

Rosenstein quickly left the meeting and prosecutors' push to revive the criminal case died, the article said.

Afterwards, the Trump administration stymied several other attempts to hold the mega retailer accountable, including prohibiting the prosecution of individual employees and foiling a civil case, ProPublica reported.

Neither the Justice Department nor the Eastern District of Texas immediately responded to a request for comment from CNBC.

In an interview with CNBC, Walmart spokesman Randy Hargrove reiterated statements he made to ProPublica. He called the investigation inappropriate and said the company is "disappointed with the improper behavior of a few Texas-based prosecutors who appear to have violated multiple Justice Department rules in the investigation of our company. We continue to work closely with federal and state law enforcement agencies across the country to fight the opioid crisis."

Hargrove added that the ProPublica story does not take into account the measures the company put into place to combat the nation's opioid addiction crisis. "During the period in question," Hargrove said, "Walmart sent over 60,000 leads about potentially concerning prescriptions and doctors to the DEA based on prescriptions that our pharmacists refused to fill."

Walmart denies taking responsibility for the deaths reportedly caused by opioids sold by the company's pharmacies, Hargrove said in follow-up comments to CNBC.

ProPublica reported that in response to Walmart's statement, Brown, the federal prosecutor in Texas, said: "Drug Enforcement Agency investigations of multiple opioid overdose deaths in the Eastern District of Texas resulted in our office opening parallel civil and criminal investigations of Walmart's pharmacy practices."

"These investigations have been handled appropriately, and according to Department of Justice policy. These investigations, which we would typically not confirm or deny, but do so now because of Walmart's statement, continue. Accordingly, it would be inappropriate to comment further on the specific facts of the case."

"Walmart chooses now to attack the investigators, a tried and true method to avoid oversight. We are confident that once all of the facts in this matter are public the hollowness of this criticism will be apparent. It is not the goal of our office to embarrass Walmart. Walmart's behavior in dispensing opioid medication in the middle of a public health crisis should embarrass Walmart."