Rep. Jerrold Nadler, D-N.Y., Democratic candidate for New Yorks 12th Congressional District, campaigns at the 79th St. Greenmarket on the Upper West Side of Manhattan, on Sunday, August 21, 2022.

Tom Williams | CQ-Roll Call, Inc. | Getty Images

 Rep. Jerry Nadler defeated his longtime colleague Rep. Carolyn Maloney in a contentious Democratic primary Tuesday in New York’s newly drawn 12th Congressional District, NBC News projects.

He’s all but guaranteed in November’s general election to win the heavily Democratic district, which merged Manhattan’s Upper West Side and Upper East Side into one and pitted the two long-serving lawmakers against each other.

Nadler and Maloney were both first elected in 1992 and have since risen to prominence in the House: Nadler chairs the Judiciary Committee, and Maloney chairs the Oversight Committee.

After he cast his ballot Tuesday morning on the Upper West Side, Nadler, 75, told NBC News he intends to keep his top spot on the Judiciary panel if he is reelected.

“Absolutely, I’ll seek to remain the top Democrat on the Judiciary Committee, and I don’t think there’s much question that that’ll happen,” Nadler said. “What I want to achieve is, I believe this country is really a democratic system — with a small d — is threatened. And we’re in a pivotal position on the Judiciary Committee to defend against that threat through voting rights legislation and administration.”

If Republicans win control of the House this fall, Nadler would lose his committee gavel and likely serve as ranking member.

Maloney, 76, had sought to play up the gender dynamics in the race, noting that she’s the only woman representing Manhattan in Congress and suggesting that Nadler was benefiting from an “old boys’ network” in New York City.

A third candidate in the race was Suraj Patel, 38, a former staffer for President Barack Obama who ran on a platform of generational change against the two septuagenarians.

Nadler’s chairmanship of the Judiciary Committee put him in a position to oversee the proceedings for both impeachments of former President Donald Trump.

In a statement after the outcome was projected, House Speaker Nancy Pelosi congratulated Nadler and praised Maloney for “tenacious leadership,” saying she will be “profoundly missed in the Congress.”

Correction: This report has been updated to correctly describe the area of Maloney’s former congressional district.