A state judge finalized New York's congressional and state Senate district maps early Saturday, putting them in place for the next decade barring any further lawsuits.

Carnegie Mellon University fellow Jonathan Cervas, who was tasked with redrawing new district lines after a set of Democrat-drawn maps were overturned, submitted his final maps late Friday night, with Acting State Supreme Court Justice Patrick McAllister ordering them into place just after midnight Saturday.

The court-approved maps were released four days after Cervas’ initial proposal set off a chaotic scramble where congressional candidates and incumbents quickly tried to stake out their turf by declaring which district they would run in – and, in the case of five districts, potentially pitting sitting members against each other. The maps also came after New Yorkers were allowed to provide input on the maps drawn by Cervas.

In his final maps, Cervas made several changes urged by politicians and members of the public, including reuniting the Bed-Stuy neighborhood in Brooklyn in the new 8th District, instead of splitting it between two. That caused several other districts in Brooklyn to change, including the Staten Island-based 11th Congressional District currently held by Rep. Nicole Malliotakis, which picked up the Bensonhurst neighborhood and became a stronger Republican district.

Cervas also made major changes on Long Island, creating a new South Shore-based district and shifting three others to account for it. But he left Manhattan as he proposed on Monday, keeping Midtown in the new 12th Congressional District with the Upper East and Upper West Sides, setting up a potentially explosive primary between longtime Democratic Reps. Carolyn Maloney and Jerrold Nadler.

Some members of the public, including members of the Jewish community, argued for a map that split Manhattan's West and East sides rather than the north-south split Cervas had proposed. But Cervas wasn't persuaded, in part because the "economic and demographic" traits of the areas on either side of Central Park aren't as different as they once were.

"Thus, while this is a hard choice, I do not find a community of interest argument for changing the configurations of congressional districts in the proposed map," Cervas wrote in court documents.

Cervas, an academic and map-making expert, was appointed by McAllister, a Steuben County Republican who heard the initial, Republican-led lawsuit challenging the congressional and state Senate lines drawn in February by the Democrat-dominated state Legislature.

McAllister ruled the Democrats unconstitutionally configured the initial congressional lines to their benefit, and that they didn’t follow proper procedure in drawing both the congressional and state Senate districts. The state’s appellate courts agreed, including the Democrat-heavy Court of Appeals, the state’s top court.

In his ruling, McAllister also pushed the congressional and Senate primaries back to Aug. 23rd to accommodate. The judge chose Cervas, who had previously been a map consultant in Pennsylvania’s redistricting process. Cervas' maps drew the ire of Democrats, including Brooklyn Rep. Hakeem Jeffries, who claimed Cervas’ original proposal was unconstitutional and drawn to benefit Republicans.

As it stands, primaries for New York’s governor, lieutenant governor and state Assembly seats are all scheduled for June 28th, the original date of the primary. Good-government organizations have warned the split primary could lead to low voter turnout, and the League of Women Voters is suing in an attempt to unify the elections.

Congressional incumbents and candidates, meanwhile, spent much of the week staking out which of Cervas' proposed districts they were planning to run in. That includes the new 10th District, which encompasses Lower Manhattan and part of Brooklyn, including most of Park Slope.

After the districts were finalized early Sunday, a sitting congressman quickly declared for the race — Rep. Mondaire Jones, a Democrat from White Plains. Jones picked the 10th District to run in after Rep. Sean Patrick Maloney, who heads the Democratic Congressional Campaign Committee, chose to run in the new 17th District in the Hudson Valley, which encompasses most of Jones' district, causing tension with Democrats who say Maloney should have picked a different seat.

Under New York and federal law, you don't have to live in a congressional district to run for it, so long as you're a resident of the state.

"I’m excited to make my case for why I’m the right person to lead this district forward and to continue my work in Congress to save our democracy from the threats of the far right," Jones tweeted early Saturday.

Jones joins a crowded field of candidates or potential candidates in the 10th District, including former New York City Mayor Bill de Blasio and Council Member Carlina Rivera, among others.