ALBANY, N.Y. (AP) — New York will hold its congressional and state Senate primaries on Aug. 23, a state judge ordered Friday.

Steuben County Judge Patrick McAllister said that special master Jonathan Cervas will finish drawing up new maps by May 20.

In the meantime, state and local election officials will prepare to once again hold separate primaries in June and August.

New York is set to hold gubernatorial and state Assembly primaries in June, unless lawmakers decide to delay.

New York’s highest court rejected Wednesday new congressional and state senate maps that had widely been seen as favoring Democrats.

The majority decision largely agreed with Republican voters who argued the district boundaries were unconstitutionally gerrymandered.

The ruling also dashed Democrats’ national redistricting hopes, which leaned heavily on their ability to gerrymander New York state to maximize the number of seats they could win in the U.S. House of Representatives.

A state board of elections spokesperson said Thursday the state is asking the U.S. Justice Department to see if a federal court might need to review any change to the date of the primary.