A federal judge in Washington state on Friday ordered the U.S. Postal Service to take “extraordinary measures” to deliver mail-in ballots in Wisconsin and Michigan in time for Election Day.

Court rulings in both states say that mail-in ballots received after Election Day won’t be counted regardless of the postmark date. Other states allow ballots to be counted as long as they’re mailed on time.

Chief U.S. District Judge Stanley Bastian in Yakima, Wash., ruled that starting Sunday through Nov. 10, the Postal Service must report to his court the prior day’s “all clear” status for each facility and processing center in the Detroit area and a district covering most of Wisconsin.

If any ballots are found during an “all clear” sweep, every effort must be made to get the ballot delivered by Election Day, including First Class and Priority Mail or any other “extraordinary measures” necessary.

MILLIONS OF MAIL BALLOTS NOT YET RETURNED IN KEY STATES 

Priority Mail Express is an overnight service that costs a minimum of $26.35 per envelope, according to the USPS.com website.

Delivery of ballots in the Postal Service's Detroit district, for example, has dipped as low as 57% over the past week while national on-time delivery is 93% or higher, Washington state Attorney General Bob Ferguson's office said Saturday.

Both Michigan and Wisconsin are crucial battleground states for President Trump and Democratic nominee Joe Biden. The president narrowly won both historically Democratic states in 2016.

Washington was among 14 states that brought an August lawsuit over changes that U.S. Postmaster General, Louis DeJoy, a Trump donor, made when he took over last May. The other states bringing the suit are Colorado, Connecticut, Illinois, Maryland, Michigan, Minnesota, Nevada, New Mexico, Oregon, Rhode Island, Vermont, Virginia and Wisconsin. 

USPS WORKER CHARGED WITH DUMPING BALLOTS, AS MAIL CARRIERS PERFORM EXTRA TRIPS BEFORE ELECTION DAY 

Earlier this month, the Postal Service’s Office of Inspector General reported that changes DeJoy made have “negatively impacted the quality and timeliness of mail delivery nationally,” according to the Wall Street Journal.

Following the ruling, Postal Service spokesman Dave Partenheimer said, “We take our legal obligations very seriously and (are) complying with all court orders. The Postal Service continues to implement extraordinary measures across the country to advance and expedite the delivery of the nation’s ballots."

He noted as of Friday, Postal Service employees were authorized to use the Express Mail network to fast-track completed ballots.

He added USPS will do extra pick-ups, extra deliveries, and collect mail on Sunday ahead of the election.

The lawsuit had challenged the Postal Service's so-called “leave behind” policy, in which trucks have been leaving postal facilities on time regardless of whether there is more mail to load. 

Bastian, an Obama appointee, noted after a previous hearing that Trump had repeatedly attacked mail-in voting by making unfounded claims that it is rife with fraud.

CLICK HERE TO GET THE FOX NEWS APP

DeJoy insists mail-in ballots are the organization’s top priority and has consented to halt some controversial changes he implemented last summer like removing mailboxes and decommissioning mail sorting machines.

The Associated Press contributed to this report.