WASHINGTON — The race for control of Congress is as close as ever, with barely two dozen House seats and a handful in the Senate likely to determine the majority this November and whether a single party sweeps to power with the White House.

Lawmakers are returning to Washington for a three-week legislative sprint, away from the campaign trail where races have become “trench warfare” and a seat-by-seat slog. Many of the highest-profile races are being waged in Montana, New York, California and beyond, far from the presidential battleground states contested by Republican Donald Trump and Democrat Kamala Harris.

“Buckle up,” said Jack Pandol, communications director for the National Republican Congressional Committee.

Upended by the shake-up that replaced President Joe Biden with Harris atop the Democratic ticket, the down-ballot campaigns enter this fall stretch at a virtual tossup in which every single seat won or lost could make the difference in party control.

What’s changed is not so much the fundamentals of the individual races, but which side has the energy and enthusiasm to make sure their voters actually show up and cast their ballots, strategists said.

Money, volunteers and voter enthusiasm are flowing to the Democratic campaigns since Harris replaced Biden. That’s challenging Republicans who entered the election cycle favored for gains and buoyed by Trump’s comeback bid, despite the criminal charges hanging over his potential return to the White House.

Trump and Republicans are working feverishly to regain the momentum they enjoyed from the GOP convention in Milwaukee and from the Supreme Court decision giving former presidents broad immunity from prosecution, including for some acts related to Trump’s effort to overturn the 2020 election and for the Jan. 6, 2021, attack on the Capitol.

Trump’s campaign staff held a private conference call Friday with House Republicans, assuring them that the movement is shifting to Trump as they game out strategies ahead, according to another Republican who spoke on condition of anonymity to discuss the closed conversation.

“There’s a lot of handwringing going on and a lot of anxiousness about where this election is headed,” said Montana Sen. Steve Daines, a Trump ally who heads the National Republican Senatorial Committee, the campaign arm.

Speaking at the Republican Jewish Coalition in Las Vegas, Daines played up GOP Senate candidates and predicted that enthusiasm from rural voters to vote for Trump will help Republicans such as Sam Brown, who is challenging Sen. Jacky Rosen, D-Nev.

Still, the fundraising gap is a problem, say GOP strategists, leaving them without money to keep pace with advertising and organizing.

In the Senate contest, Democrats are almost certain to see their narrow majority slip to a 50-50 split at best with the retirement of independent Sen. Joe Manchin of West Virginia. His departure is making way for Republican Gov. Jim Justice to handily win that seat.

Trump is wildly popular in Montana, where Senate Republicans see their best chance to go on offense as they challenge Democratic Sen. Jon Tester. But Tester is also a popular figure there, where a whopping $238 million- plus is being spent on ads.

Senate Republicans had the advantage this cycle, with few incumbents to protect, allowing them to challenge Democrats with handpicked, often wealthy recruits in Pennsylvania, Ohio and Wisconsin. Democrats have only more recently gone on offense in long-shot races against GOP Sens. Ted Cruz of Texas and Rick Scott of Florida.

But incumbents often bring longevity and name recognition to the race, making them tough to topple, as is the case in Pennsylvania, where Democrat Sen. Bob Casey is being challenged by Republican Dave McCormick, and in Ohio, where Sen. Sherrod Brown is running a playful cookie-eating television ad as he faces Republican Bernie Moreno.

For the open seat in Democrat- heavy Maryland, the state’s popular former Republican governor, Larry Hogan, who was courted to run by Senate Republican leader Mitch McConnell, is in a tough matchup against county executive Angela Alsobrooks. She would make history as one of the few Black women elected to the Senate.

In the House contests, Republicans are trying to protect 18 Republicans in Democratic-heavy congressional districts where Biden had won, particularly in coastal New York and California, and going on offense to challenge Democrats elsewhere.

But House Democrats, whose campaign chairwoman, Rep. Suzan DelBene of Washington state, was among those who spoke privately to Biden about the potential down-ballot drag as he weighed his decision to exit the race, are benefiting from the Harris momentum.

Democrats are working to protect their own most embattled House lawmakers, a handful of pragmatic legislators including Marcy Kaptur in Ohio, Matt Cartwright in Pennsylvania and three younger lawmakers who lead the centrist Blue Dog coalition — Mary Peltola of Alaska, Marie Gluesenkamp Perez of Washington state and Jared Golden of Maine.

Each faces a notable Republican: Nick Begich, from an Alaskan political family; Washington’s Trump-endorsed Joe Kent; and former NASCAR driver Austin Theriault in Maine.