This file photo taken on Dec 4, 2021 shows the US Supreme Court in Washington, DC. (DANIEL SLIM / AFP)

MARIETTA, Georgia – Hours before US midterm voters head to the polls on Tuesday, courts were hearing a handful of last-minute lawsuits that could govern election rules and the counting of ballots in battleground states.

The lawsuits, filed in states with key races, mark the tail-end of a months-long legal push by Democrats and Republicans to define the rules for voting in Tuesday's election. Attorneys are also preparing for post-election challenges in the days and weeks after the midterms.

US Senate candidate John Fetterman and other Democrats sued in a Pennsylvania federal court on Monday to force officials to include undated mail-in ballots in the state's vote count.

The American Civil Liberties Union filed a similar lawsuit on behalf of voting rights groups in Pennsylvania on Friday.

Last week the Pennsylvania Supreme Court granted a Republican request to block the ballots from being counted but gridlocked on whether doing so would violate civil rights law.

In Georgia, the ACLU and lawyers for Cobb County were also in court on Monday, finalizing an agreement for a judge to extend a ballot delivery deadline until Nov 14 for hundreds of voters who requested absentee ballots but did not receive them

In Georgia, the ACLU and lawyers for Cobb County were also in court on Monday, finalizing an agreement for a judge to extend a ballot delivery deadline until Nov 14 for hundreds of voters who requested absentee ballots but did not receive them.

The agreement, signed by Cobb County Superior Court Judge Kellie Hill on Monday, followed an ACLU lawsuit on behalf of some 1,036 voters. Those voters will now have the option of using an alternative write-in form typically used by members of the military overseas whose ballots are late.

Cobb County has been overnighting ballots to affected voters and estimated on Monday that 276 voters had yet to receive a ballot. Officials said their goal was to get them to voters by Tuesday so the ballots can be postmarked by Election Day.

In Arizona, a judge on Monday blocked officials in Cochise County from conducting a hand count of all ballots cast in Tuesday's elections, finding that the county board of supervisors that ordered the count had "no authority" to do so.

Lawyers aligned with both Democrats and Republicans have brought waves of lawsuits over the rules for the upcoming election.

Tuesday’s vote will determine political control of Congress for the next two years, defining the second half of President Joe Biden’s term and the federal government’s policy priorities, as well as control of governorships in swing states.

ALSO READ: Advisers: Trump considers presidential bid after midterm

Close races

While none of the lawsuits threatens sweeping changes to Election Day rules, they could affect close races, like those for US Senate seats in Pennsylvania and Georgia, that will help determine party control of the Senate.

Fetterman and Republican Mehmet Oz are neck-and-neck in the Pennsylvania polls.

Georgia’s Cobb County is part of the populous Atlanta metropolitan area, which played a key role in Democrats' 2020 election wins. Democrat Raphael Warnock and Republican Herschel Walker are in a close US Senate race in that state.

In the Cochise County hand count case, Arizona’s secretary of state’s office has argued that the longer hand-count process could risk the state’s ability to certify its election results by a Dec 5 deadline.

Some jurisdictions adopted hand counts following debunked but widespread claims of voter fraud in the 2020 election. US officials have called 2020 the most secure count in the country's history.

READ MORE: Biden casts early vote in polarized midterm elections

Judge Casey McGinley in Arizona, who blocked the Conchise County hand count on Monday, said he was presented "no evidence" that the machine tabulation of ballots is inaccurate.

Another hand count in Nevada’s rural Nye County was shut down in favor of machine counting after the state supreme court struck down parts of the process.