Rep. Jerrold Nadler won the Democratic primary for New York’s 12th Congressional District in Manhattan, surviving a heated race that pitted him against fellow 30-year incumbent Carolyn Maloney in an unprecedented clash of two of New York’s longest-serving House members.

The Associated Press called the race at 9:38 p.m. Tuesday, with Nadler also defeating challengers Suraj Patel, an attorney, and Ashmi Sheth, a former Federal Reserve employee.

The victory all but ensures Nadler will return to Congress to represent Midtown and the Upper East and West sides, which were drawn into a single, heavily Democratic district by a court-appointed mapmaker earlier this year. Nadler will now go on face off against Republican candidate Michael Zumbluskas in the November 8th general election.

"I think the voters made themselves clear tonight," Nadler said alongside supporters at Arte Cafe on the Upper West Side. He also took a moment to thank Patel and Maloney, whom he thanked for her decades of service to New York City. "I'm humbled by the way we worked together to achieve this victory. We won with votes from the East Side and the West Side."

Nadler added he plans to head back to Congress with a "mandate to fight for the causes so many of us know to be right."

The result also ensures New York City will lose a senior member of the House in Maloney, who, like Nadler, was first elected to Congress in 1992 and had risen the ranks to become an influential committee chair.

The battle of New York political titans was brought on by the state’s botched, once-a-decade redistricting process, in which the courts ruled a Democrat-drawn congressional map was unconstitutionally gerrymandered to benefit the party. That initial set of lines would have split the Upper East and Upper West sides, preserving separate districts for Nadler and Maloney.

Rep. Carolyn Maloney concedes in the race against Rep. Jerrold Nadler and Suraj Patel for New York's 12th congressional district.

Once the new lines were in place, both Maloney and Nadler quickly declared for the 12th Congressional District – deciding to run against each other rather than one of them opting for a new Lower Manhattan- and Brooklyn-based 10th Congressional District. That left the 10th without an incumbent, leading to a 12-way Democratic primary free-for-all in the district.

Nadler, chair of the House Judiciary Committee — which oversaw the impeachment process of former President Donald Trump — is the longest-tenured member of New York’s congressional delegation. Maloney – who chairs the House Oversight Committee – is tied for second, having taken office two months after Nadler.

The two veteran lawmakers had been considered friendly – if not allies – for most of their time in office. And during a WNYC-Spectrum News NY1 debate earlier this month, they found plenty of agreement – including by initially declining to say President Joe Biden, the Democratic standard-bearer, should run for re-election in 2024.

“We have been friends and allies for years,” Maloney said during the debate. “Unfortunately, we were drawn into the same district. I would have much preferred to have the old district that I had.”

Maloney frequently highlighted the need for more women in Congress and tried to paint herself as the antidote to the “Old Boys' Club.” In recent weeks, she highlighted Nadler’s uneven debate performance and fanned the flames of rumors suggesting he may not be willing to serve a full, two-year term (Nadler has pledged to serve the full term if elected).

Nadler, meanwhile, highlighted his differences from Maloney by pointing to his voting record. In particular, he frequently referred to his votes against the Iraq War and the Patriot Act, and for the Iran nuclear deal in 2015. Maloney voted the opposite way on all three measures.

Maloney also faced extensive criticism from Patel and Nadler over her past skepticism over vaccines, which included comments questioning whether they are connected to autism. As recently as 2015, she was one of two co-sponsors of legislation that would have required the National Institutes of Health to study the incidence of autism in vaccinated vs. unvaccinated people. She tried to counteract those lines of attack by highlighting her work to bring COVID-19 vaccine centers to her district, but her opponents were unrelenting.

Despite a shaky performance in that first televised debate, Nadler scored the coveted New York Times endorsement and then adopted a Rose Garden strategy, a term for candidates who avoid the press and public in the final week ahead of the election, avoiding additional media appearances in favor of carefully choreographed retail outreach in the district.

“In many ways, he’s been the front runner, or has felt like the front runner, so you don’t go making errors when you don’t have to,” said Christina Greer, an associate political science professor at Fordham University. “I think that was his strategy and I think it was a smart strategy.”

Given the unusual timing of the primary, experts said predicting who would vote was no small challenge.

“A challenge is the polite way to put it,” said David Birdsell, the provost and senior vice president for academic affairs at Kean University and the former dean of the school of public and international affairs at Baruch College. “A complete crapshoot would be accurate as well.”

Birdsell noted that primary elections already tend to draw a smaller number of voters to the polls.

He also said the impact of the winner in this district is likely to be felt across the city and state.

“One way or another, the residents of the new District 12 lose a [committee] chair and that is a loss of a position for a state that has, of course, lost a seat in Congress,” said Birdsell. “It further diminishes the clout the city has on the operations of Congress.”

Now, Nadler will move on to a general election in November, where he will be heavily favored.

Of the 440,000 active registered voters in the 12th district, nearly 300,000 are enrolled as Democrats, making it one of the bluest districts in the country. Just 43,000 of the voters are enrolled Republicans, according to state data.

The optimistic mood at Maloney’s election night party quickly turned to surprise and frustration as news outlets began to call the race for Nadler. Some refused to believe that the contest could be over that quickly.

“I don’t think it’s over yet,” said Maloney supporter Shari Weiner, who noted that many East Side voters had cast their ballots absentee. “I can’t imagine that she’s going to concede tonight. She’s going to wait until every vote is counted.”

But as the numbers continued to favor Nadler, Weiner said she was feeling “anger that the Old Boys’ club won.”

“Women are disenfranchised again,” she said. “We’re stepped on one more time.”

As a livestream of Nadler’s victory speech played on the TV, people booed and moaned. Some shook their heads and heckled the television.

“Does he really have the competence and the stamina to serve another two years? I don’t think so,” Weiner said.

Dianna Campbell, a Maloney supporter who lives in the East Village, said she was shocked by the results.

“We’re devastated,” she said. “Oh my god.”

Campbell noted that Maloney has been a strong supporter of topics that matter to her, including rare disease research, climate change and women’s rights.

“I want to see women win,” she said, adding that she hopes Nadler will pick up some of Maloney’s key policy priorities, including passing the Equal Rights Amendment.Campbell couldn’t believe the numbers. She thinks redistricting confused many New Yorkers – herself included.

She also assumes that an oddly timed Primary Day limited voter turnout.

“Having it now when people are vacationing, getting their kids ready to go to school and all that – it’s just, the timing is just awful,” she said.Sybil Shainwald was disappointed to see her “favorite person” losing her spot in Congress. She blamed Sen. Chuck Schumer for intervening in the race and endorsing Nadler.“She deserved to win,” Shainwald said.

The story has been updated to include Nadler's comments and reaction from Maloney's supporters.