The Trump administration on Monday asked the Supreme Court to clear the way for an executive order by President Trump that restricts voting by mail, setting up a legal showdown as the president pushes for more control over voting ahead of the midterm elections in November.

The administration filed the emergency application to the justices after a federal appeals court on Saturday blocked key parts of his executive order.

In the application, Solicitor General D. John Sauer called the lower court ruling “indefensible,” asserting that it imposed “serious irreparable harm on the federal government” and would bar federal agencies from implementing an executive order “promoting election integrity in the upcoming federal elections in November.”

The legal battle stems from an executive order signed up Mr. Trump in late March that had attempted to place limits on mail-in voting, including using federal oversight of the U.S. Postal Service to gain greater control over mail-in voting practices.

The executive order directed the Department of Homeland Security to create state-by-state citizen lists that would help determine voter eligibility. It then called on the Postal Service to use lists provided by states to determine if voters should be allowed to vote by mail.

More than 20 Democratic attorneys general challenged the order in court, arguing that it violated several provisions of the Constitution, including the separation of powers, by having the executive branch take control of functions usually regulated by Congress and the states.