A New Jersey federal judge shot down the Trump campaign‘s attempt to halt the state’s new mail-in voting rules, including one that allows ballots to be counted two days after Election Day even if they do not have a postmark.

In a Tuesday opinion, Judge Michael Shipp denied the campaign’s request for a preliminary injunction, ruling that the state acted within its authority to issue the rules.

NEW JERSEY RESIDENTS RECEIVING BALLOTS FOR OUT-OF-STATE VOTERS, DEAD PEOPLE; ELECTION OFFICIALS CONFIDENT IN ANTI-FRAUD MEASURES: REPORTS

“Although federal law prohibits New Jersey from canvassing ballots cast after Election Day, it is within New Jersey’s discretion to choose its methods of determining the timeliness of ballots, so long as there is no appreciable risk of canvassing untimely ballots,” the court’s ruling said.

The judge cited case law supporting New Jersey’s right to take its desired measures to protect voters from exposure to COVID-19, stating that decisions regarding “the safety and health of the people” are constitutionally entrusted to elected officials.

Shipp also said the campaign failed to demonstrate a likelihood of irreparable harm that it would suffer should the rules be upheld.

Another rule the campaign challenged in the lawsuit allows the state to pre-canvass, or begin processing votes without reporting tallies, as early as 10 days before Election Day. Shipp said as long as the results of those ballots are not announced until polls are closed the state is allowed to do this. Most states allow pre-canvassing to begin at least one day before Election Day, and lawmakers in swing states like Pennsylvania and Michigan are pushing for the ability to do so in order to avoid delays in determining election results.

The decision does not technically end the case, but with less than a month until Election Day, it is a significant ruling for the state that will keep the current rules in place, barring a swift and successful appeal from the Trump campaign.

PHIL MURPHY SLAMS TRUMP OVER NEW JERSEY FUNDRAISER, SAYS EVENT IS UNDER INVESTIGATION

New Jersey Attorney General Gurbur Grewal celebrated the decision.

“A major victory for New Jersey’s voters! Today, a federal judge rejected a challenge to NJ’s new elections laws,” Grewal tweeted Tuesday. “As your AG, I will keep fighting for your right to vote and your right to remain healthy. You shouldn’t have to choose.”

Fox News reached out to the Trump campaign for comment but it did not immediately respond.

Meanwhile, the state is already experiencing problems, as some residents have received ballots meant for people who have moved out of the state and for deceased voters, but some election officials say they’re confident that anti-fraud measures will take care of it, according to local reports.

A local election in the city of Paterson, N.J., earlier this year also made national headlines after several individuals, including the winner of a city council race, were charged with crimes related to voter fraud.

CLICK HERE TO GET THE FOX NEWS APP

Republicans had a number of recent court victories in other states in cases dealing with election issues, including deadlines for accepting ballots, but those involved states where the existing laws kept the voting deadline on Election Day and Democrats were looking to change them.

A court did grant such an extension in Pennsylvania, but Republicans are awaiting a Supreme Court review of that decision.

Fox News’ Michael Ruiz contributed to this report.