NEW YORK (AP) — The national fight for control of the U.S. House of Representatives will be partly decided Tuesday on a battleground that seemed unlikely a year ago: New York City’s suburbs.

One of the nation’s bluest states, New York has become an unexpected opportunity for Republicans due to voter dissatisfaction and a more favorable political map.

In one of the most closely watched races, U.S. Rep. Sean Patrick Maloney, the five-term Democrat who was supposed to be leading his party’s attempt to hold on to Congress, is fighting for survival in a district in the Hudson River Valley.

Maloney, the chair of the Democratic Congressional Campaign Committee, faces Republican state Assemblyman Mike Lawler, who ran a spirited campaign focusing on the high cost of gasoline and other pocketbook issues.

Republicans also ran competitive campaigns in all four congressional districts on Long Island, on Staten Island and in other battlegrounds in the Hudson Valley and Catskills.

Those bunches of close races seemed an impossibility earlier this year, when the Democrat-controlled state Legislature redrew the boundaries of New York’s congressional districts along party-friendly lines.

Courts threw those maps out, however, citing procedural errors and overt partisanship. New maps of the state’s 26 congressional districts were then drawn by a court appointee, who prioritized creating as many competitive districts as possible.

“New York was the crown jewel in their redistricting, where they thought they could draw the maps much more to their advantage to try to offset what Republicans did in Florida or Texas,” said University at Buffalo political science professor Shawn Donahue.

Instead, Republicans are running in more favorable districts as they relentlessly attack Democratic opponents over inflation and fear of crime.

Democratic candidates have stressed support for abortion rights in the wake of the Supreme Court’s decision to overturn Roe v. Wade. Some have cast themselves as champions of democracy, running against Republicans who didn’t accept the results of the 2020 presidential election.

Maloney, who was the first openly gay New Yorker elected to Congress, had a track record of winning in a Republican-leaning district, but the redistricting plan put him in a reconfigured territory where fewer voters know him.

National Republican groups, sensing an opportunity, spent millions on advertisements supporting Lawler, a former executive director of the state Republican party who worked in local government before his election to the Assembly in 2020.

Further north in the Hudson Valley, freshly minted U.S. Rep. Pat Ryan, a Democrat, is trying to replicate his surprise win in an August special election.

Ryan boosted Democrats’ spirits after winning a race to finish out the term of former U.S. Rep. Antonio Delgado, who had resigned to become New York’s lieutenant governor.

Ryan campaigned hard on abortion rights and national Democrats hoped his win could provide a roadmap for more congressional victories in November.

He’s now running for a full term in a different district against Republican Colin Schmitt, a second-term state Assemblyman who campaigned on economic issues and his service as a sergeant in the Army National Guard.

The Republican Ryan defeated in the special election, Dutchess County Executive Marc Molinaro, is now running a close race against Democrat Josh Riley in a sprawling new district that runs from the Massachusetts border all the way to Ithaca — the small city in the Finger Lakes region that is home to Cornell University.

Long Island is an especially active battleground with three of its four congressional seats open due to incumbents not seeking re-election.

Republicans had an unexpectedly strong showing in local elections on Long Island last year and reached for possible upsets in two congressional districts now represented by Democrats.

In one, Democrat Robert Zimmerman faces Republican George Santos in the first U.S. congressional race featuring two openly gay candidates.

In the other, Democrat Laura Gillen, an attorney and one-term supervisor of the town of Hempstead, faces Republican Anthony D’Esposito, a member of Hempstead’s town council and a former New York Police Department detective.

Further east on Long Island, Democrat Bridget Fleming faces Republican Nicholas LaLota in a reworked version of the congressional district now represented by U.S. Rep. Lee Zeldin, who decided not to seek reelection so he could run for governor.

Fleming is a former sex crimes prosecutor in New York City and member of the Suffolk County Legislature. LaLota serves as the Suffolk Legislature’s chief of staff.

Republican U.S. Rep. Andrew Garbarino faces Democrat Jackie Gordon in a race on Long Island’s increasingly diverse South Shore.

The lone Republican representative in New York City, Nicole Malliotakis, also faces a rematch. Democrat Max Rose is running in a district consisting of Staten Island and a slice of Brooklyn. Rose represented Staten Island in Congress until Malliotakis ousted him in 2020.

One closely watched race in upstate New York is in the Syracuse area, where Republican Rep. John Katko is leaving after four terms. That race pits Republican Brandon Williams against Democrat Francis Conole.

Williams, a first-time candidate living outside the district, is a U.S. Navy veteran and tech entrepreneur who moved to the region full time several years ago. Conole is a U.S. Naval Academy graduate and current U.S. Naval Reserve captain. The Syracuse resident has never held elective office.