A Minnesota judge has granted a temporary restraining order against the US Department of Homeland Security (DHS), barring officials from altering or destroying evidence in the killing of anti-ICE protester Alex Pretti in Minneapolis.

The order, requested by the Minnesota Bureau of Criminal Apprehension (BCA) and granted by US District Court Judge Eric Tostrud, will remain in effect through Monday afternoon.

A court hearing is scheduled for Monday at 3 p.m. ET in St. Paul.

The judge barred evidence in the Alex Jeffrey Pretti case from being destroyed. AP

Footage of Pretti being tackled by federal agents before the shooting.

A federal agents seen drawing his gun before shooting Pretti.

Trump-appointed Judge Tostrud is expected to rule on possibly extending the temporary restraining order on Monday, with defendants including DHS Sec. Kristi Noem having until Monday at 12 p.m. to file objections or any other response.

Other defendants include Immigration and Customs Enforcement (ICE), Customs and Border Patrol and Attorney General Pam Bondi.

Under the temporary injunction, federal officials and those acting on their behalf cannot destroy evidence taken from the scene of the shooting, or now in their exclusive custody, Judge Tostrud wrote.

The DHS said Pretti approached Border Patrol agents armed with a 9 mm pistol and “violently resisted” attempts to disarm him.

It comes amid a lawsuit filed by the BCA in the wake of the killing of ICU nurse Pretti on Saturday morning, alleging the DHS mishandled evidence at the scene of Saturday’s shooting while federal agents were detaining an alleged criminal migrant in south Minneapolis.

Pretti was an ICU nurse at a VA hospital in Minneapolis. via REUTERS

The DHS claimed that Pretti “violently resisted” arrest at the protest. AP

DHS representatives allegedly blocked the BCA from accessing the scene of the shooting, even though the bureau had obtained a signed search warrant from a judge.

Follow The Post’s coverage of the shooting of a 37-year-old anti-ICE protester in Minneapolis

“We’re in uncharted territory here,” BCA Superintendent Drew Evans said at a press conference Saturday about allegedly being shut out of the investigation into Pretti’s death.

“It’s been a long-standing understanding, both within our state and across the country, that entities like the BCA that conduct 80-plus percent of officer-involved shootings across the United States are asked to do these investigations of federal agents involved in officer-involved shootings,” Evans said.

The handgun Pretti was carrying at the protest. Minneapolis Police

Far-left Attorney General Keith Ellison called for a “full, impartial, and transparent” investigation into the shooting following Saturday’s ruling.

“Alex Pretti was killed by DHS agents in broad daylight in front of all of our eyes. Both the rule of law and the sense of justice we all carry within us demand a full, fair, and transparent investigation into his death,” Ellison said.

Hennepin County Attorney, Mary Mariarty, added that the lawsuit is just one of her office’s actions “to ensure that a thorough and transparent investigation can be completed at a state level,” in a statement.

“As I said earlier today, I will not rest, my team will not rest, until we have done everything in our power, everything within our authority, to achieve transparency and accountability,” Moriarty said.

“Our office has jurisdiction to review this matter for potential criminal conduct by the federal agents involved and we will do so,” she added.