WASHINGTON >> Control of the House is on a knife’s edge, with Democrats and Republicans from the liberal coasts to the nation’s heartland running neck-and-neck in the key races that will decide which party will hold the majority in the next Congress.

Public and private polling, as well as interviews with strategists and operatives in both parties, point to one of the tightest contests yet for the House majority, which Republicans now hold by a mere four seats. While the vast majority of the 435 seats in the House are not in play, the roughly two dozen that are being contested are truly up for grabs. Of the 22 races rated most competitive by the nonpartisan Cook Political Report, 20 are within the margin of error in internal Democratic polling.

“We started with a narrow margin, we’re ending with a narrow margin,” said Ian Russell, a former deputy executive director of the House Democrats’ campaign arm who this year is advising Rep. Jared Golden of Maine, one of the party’s most vulnerable incumbents. “It’s close because it’s a presidential year and it’s going to be close at the presidential level.”

The battlefield includes centrist Democratic incumbents in Maine, Washington, Alaska and Pennsylvania who are trying to hang on in their rural districts that favor former President Donald Trump and Midwestern Republicans facing unexpectedly steep challenges in Nebraska, Iowa and Wisconsin.But control of the House may ultimately come down to about nine competitive races in blue states on the East and West coasts, where Republicans in liberal-leaning districts are attempting to stave off Democratic challenges and protect five seats in California and four in New York.

Democrats have run aggressively on protecting reproductive rights, and especially in more conservative districts where incumbents are at risk, have emphasized measures passed in President Joe Biden’s landmark Inflation Reduction Act, including slashing the price of insulin.

Republicans’ message has focused instead on inflation, public safety and immigration.

The biggest obstacle for Democrats seeking to take the House, said David Winston, a veteran Republican pollster and strategist, is that polling indicates most Americans think the country is on the wrong track. A nationwide New York Times/Siena College poll conducted in late October showed that 61% of likely voters said the country was headed in the wrong direction.

“The challenge for Democrats here in this environment — and inflation is driving this environment — is, how are they not the status quo?” Winston said. “And what are they going to do to change things and making some separation from Biden?”

In many districts, candidates’ fate may rest on how Trump and Vice President Kamala Harris perform. Polling has shown an extremely close race between the two candidates in battleground states, but strategists in both parties say that Trump is generally on pace with his 2020 performance or doing slightly better in battleground districts in blue states, while Harris is on track to match Biden’s 2020 performance in key districts in the Midwest. At the same time, they expect suburban voters to continue peeling away from Trump, a shift that helped Democrats take back the House in 2018.

The past two House cycles were marked by conventional wisdom in the run-up to Election Day that turned out to be wrong. In 2020, when Democrats expected to expand their majority, they instead were set back on their heels and lost seats. In 2022, the so-called “red wave” that Republicans predicted would deliver them an ample majority never materialized, instead giving them control of the House by a razor-thin margin.

A year ago, House Republicans were openly fretting that voters would punish them at the ballot box for a historically chaotic Congress, beginning with the bitter infighting that had marked the election of Kevin McCarthy as speaker, featuring dysfunction on the floor wrought by hard-right rebels and culminating in Mr. McCarthy’s ouster and three weeks of GOP paralysis while they were unable to coalesce around a leader.

By summer, it was Democrats’ turn to fret following Biden’s disastrous debate performance, as polling showed Democrats in tight races that they would need to outrun him in some cases by double digits in order to win reelection.

Now, with Harris at the top of the ticket, the only certainty is that the crucial contests are closer than ever.

Here is a look at the toss-up races that will decide control of the House.

The Biden Republicans in blue states

The improbable heart of the battle for House control is the liberal states of New York and California, where Republicans are defending Biden-friendly territory. Democrats arguably lost their majority in these districts in 2022, as voters registered their dissatisfaction with the states’ high living costs and fears about public safety.

In New York, the two Republicans in most danger are Reps. Brandon Williams in Syracuse and Anthony D’Esposito on Long Island, both first-term members of Congress in districts Biden handily won in 2020.

In California, Rep. John Duarte, a in his first term from the Central Valley, is seen as the party’s most vulnerable member. A number other seats, including those held by Reps. Michelle Steel in Orange County, one of the first Korean American women to serve in Congress and a prodigious fundraiser, and Mike Garcia, a former Navy combat pilot in the Antelope Valley, are hotly contested.

Many Republicans holding these swing seats are battle-tested and have become adept at distancing themselves from the most extreme elements in their party.

Still, some may be unable to weather a wave of Democratic enthusiasm in increasingly liberal-leaning districts. In Omaha, Nebraska, known as the “blue dot” in the otherwise solidly Republican state, Rep. Don Bacon, a mainstream conservative with long-standing bipartisan credentials, is in the fight of his political life to hang onto his seat.

The Trump Democrats

Republicans have long hoped to unseat the small group of Democrats who hold the rural, working-class districts that Trump won in 2020. But those Democrats, including Golden in Maine, Marie Gluesenkamp Perez of Washington, Mary Peltola of Alaska and Matt Cartwright of Pennsylvania, have all established centrist brands for themselves, making them particularly difficult to dislodge.

Republicans are betting that this year, with better challengers and increased turnout among Trump voters, they will finally be able to flip some of these seats.

The open seats vacated by Democrats

Democrats are toiling to defend a trio of seats vacated by well-known, prolific fundraisers who have been able to keep the swingy districts solidly in Democratic control for years. Reps. Elissa Slotkin of Michigan and Abigail Spanberger of Virginia, who flipped their seats in 2018 to hand Democrats the majority, are seeking higher office; Slotkin is running for Senate and Spanberger for governor.

A third, Rep. Dan Kildee of Michigan, the scion of a political dynasty in the state who has served in the House for over a decade, announced he would retire after a recent cancer diagnosis.