The mail ballot deadline is being loosened for voters in Bucks and Delaware Counties, judges ordered Tuesday.

Bucks County voters whose ballots were postmarked by Monday, June 1, will have their votes counted as long as county elections officials receive them by next Tuesday, June 9, county spokesperson Larry King said.

He quoted Common Pleas Court Judge James McMaster as saying it is within his power to enforce the intent of the law and that “the clear intent of the election code is to allow people to vote.” An order was still being written late Tuesday afternoon and was expected to be available Wednesday.

Delaware County voters will have their ballots counted if they are postmarked by Tuesday, June 2, and arrive by 5 p.m. next Tuesday.

In addition, Delaware County elections officials will send out ballots to the final 400 to 500 voters whose ballots they never mailed. Officials had previously said those ballots couldn’t arrive in time, so they wouldn’t be sent. Those ballots will be counted if they are returned to the county by 5 p.m. on June 12 — regardless of when they are mailed and postmarked.

"Our election bureau is printing them, and we called in people to assemble them, and they'll be driven down to the post office tonight," said Delaware County Councilwoman Christine Reuther.

» READ MORE: Live coverage of the 2020 Pennsylvania primary election

In both counties, the ballots affected by the order will be kept separate from ballots that arrive before the normal deadline. That will allow for any legal challenges to the order. (If the orders are later overturned, those ballots will be able to be removed from the rest of the county’s results.)

Elections officials in both counties had petitioned their respective Courts of Common Pleas to extend mail ballot deadlines that they said would disenfranchise voters who received ballots too late to return them by 8 p.m. election day, as state law requires. Elections officials have warned that thousands of voters could be disenfranchised, despite their efforts to set up drop boxes at the last minute.

Like other counties in the state, they have faced an unexpected surge in mail ballots due to both the coronavirus pandemic and a change to state law that for the first time allows any voter to vote by mail.

Citing the civil unrest that broke out over the weekend, Gov. Tom Wolf on Monday signed an 11th-hour order allowing ballots in Philadelphia and five other counties, including Delaware County, to be counted if they are postmarked by Tuesday and arrive by June 9. Bucks County was not included in that order.

Despite that order, Delaware County filed its request in court Tuesday because, Reuther said, they needed a specific solution for the 400 to 500 voters whose ballots were never mailed out. In addition, if the governor's order is successfully challenged in court, the county-specific order would remain intact.

Now, county officials said, voters who risked disenfranchisement will now their votes counted.

“It gives you faith in the system,” said Diane M. Ellis-Marseglia, chair of the Bucks County commissioners. “There may not have been a legislative fix for this, but there was a judicial fix for this. And that’s why our constitutional system works.”