Sen. Maggie Hassan, D-N.H., gives two thumbs up to supporters during an election night campaign event Tuesday in Manchester, N.H. Credit: Charles Krupa / AP

WASHINGTON (AP) — Control of Congress hung in the balance early Wednesday, with both parties notching victories in some of the most competitive races in a midterm election that centered on voter frustration over high inflation and the sudden rollback of abortion rights.

Democrats held a crucial Senate seat in New Hampshire, where incumbent Maggie Hassan defeated Republican Don Bolduc, a retired Army general who had initially promoted former President Donald Trump’s lies about the 2020 election but tried to shift away from some of the more extreme positions he took during the GOP primary. Republicans held Senate seats in Ohio and North Carolina.

A district-by-district fight was underway for control of the House, where Democrats held closely watched seats in moderate suburban districts from Virginia to Kansas and Rhode Island. Rep. Elaine Luria, a Navy veteran who serves on the House committee investigating the Jan. 6 insurrection, was the first Democratic incumbent to lose a highly competitive House district. Many of the districts that could determine House control in states like New York and California had not been called.

ELECTION RESULTS

The outcome of races for House and Senate will determine the future of President Joe Biden’s agenda and serve as a referendum on his administration as the nation reels from record-high inflation and concerns over the direction of the country. Republican control of the House would likely trigger a round of investigations into Biden and his family, while a GOP Senate takeover would hobble Biden’s ability to make judicial appointments.

Democrats were facing historic headwinds. The party in power almost always suffers losses in the president’s first midterm elections, but Democrats had been hoping that anger from the Supreme Court’s decision to gut abortion rights might energize their voters to buck historical trends.

In Pennsylvania, Democratic Attorney General Josh Shapiro beat Republican Doug Mastriano to keep the governorship of a key presidential battleground state blue. Shapiro’s victory rebuffed an election denier who some feared would not certify a Democratic presidential win in the state in 2024. Florida Gov. Ron DeSantis and Texas Gov. Greg Abbott, two future possible Republican presidential contenders, beat back Democratic challengers to win reelection in the nation’s two largest red states.

In Georgia, Democratic Sen. Raphael Warnock and Republican challenger Herschel Walker were vying for a seat that could determine control of the Senate.

AP VoteCast, a broad survey of the national electorate, showed that high inflation and concerns about the fragility of democracy were heavily influencing voters.

Half of voters said inflation factored significantly, with groceries, gasoline, housing, food and other costs that have shot up in the past year. Slightly fewer — 44 percent — said the future of democracy was their primary consideration.

Overall, 7 in 10 voters said the ruling overturning the 1973 decision enshrining abortion rights was an important factor in their midterm decisions.

VoteCast also showed the reversal was broadly unpopular. About 6 in 10 say they are angry or dissatisfied by it, while about 4 in 10 were pleased. And roughly 6 in 10 say they favor a law guaranteeing access to legal abortion nationwide.

There were no widespread problems with ballots or voter intimidation reported around the country, though there were hiccups typical of most Election Days.

Voters also were deciding high-profile races for Senate or governor in places such as Pennsylvania, Nevada, Wisconsin, Arizona and Michigan. Contests also were on the ballot for secretaries of state, roles that typically generate little attention but have come under growing scrutiny as GOP contenders who refused to accept the results of the 2020 campaign were running to control the management of future elections.

In the first national election since the Jan. 6 insurrection, some who participated in or were in the vicinity of the attack on the U.S. Capitol were poised to win elected office, including several running for House seats.

In Ohio, Rep. Marcy Kaptur defeated Republican J.R. Majewski, who was at the U.S. Capitol during the deadly riot and who misrepresented his military service.

Democratic Reps. Abigail Spanberger and Jennifer Wexton held off spirited Republican challengers in Virginia districts the GOP had hoped to flip.

The 2022 elections are on track to cost a projected $16.7 billion at the state and federal level, making them the most expensive midterms ever, according to the nonpartisan campaign finance tracking organization OpenSecrets.

All House seats were up for grabs, as were 34 Senate seats — with cliffhangers especially likely in Pennsylvania, Georgia and Arizona.

Trump lifted two Republican Senate candidates to victory in Ohio and North Carolina. JD Vance, the bestselling author of “Hillbilly Elegy,” defeated 10-term congressman Tim Ryan, while Rep. Ted Budd beat Cheri Beasley, the former chief justice of the state Supreme Court.

Thirty-six states were electing governors. The GOP faced unexpected headwinds in flipping the governor’s office in conservative Kansas. Democrats, meanwhile, were nervous about their prospects in the governor’s race in Oregon, typically a liberal bastion.

Democrats easily repelled Republicans backed by Trump in several left-leaning states, while tougher tests that could decide control of Congress and the future of Biden’s presidency awaited in more competitive territory.

Despite their liberal history, states like Massachusetts, Maryland and Illinois have elected moderate Republican governors in the past. But the Republicans this year appeared to be too conservative in these states, handing Democrats easy victories in midterm elections that could otherwise prove difficult for the party.

Massachusetts and Maryland also saw historic firsts: Democrat Maura Healey became the first woman elected as Massachusetts governor, as well as the first openly lesbian governor of any state, and Wes Moore became the first Black governor of Maryland.

Healey bested Geoff Diehl in Massachusetts and Moore beat Dan Cox in Maryland, while Illinois Gov. J.B. Pritzker defeated state Sen. Darren Bailey. Bolduc, Cox and Bailey were among the far-right Republicans that Democrats spent tens of millions of dollars to bolster during the primaries, betting they would be easier to beat in general elections than their more moderate rivals.

An especially strong election for the GOP could have put pressure on Biden to opt against a reelection run in 2024. Trump, meanwhile, may try to capitalize on GOP gains by formally launching another bid for the White House during a “very big announcement” in Florida next week.

The former president endorsed more than 300 candidates in the midterm cycle and is hoping to use Republican victories as a springboard for a 2024 presidential campaign.

“Well, I think if they win, I should get all the credit. And if they lose, I should not be blamed at all. But it will probably be just the opposite,” Trump said in an interview with NewsNation.

It could be days or even weeks before races — and potentially, control of Congress — are decided. Some states with mail voting, such as Michigan, saw an increase in ballot returns compared with the 2018 midterm. Those votes can take longer to count because, in many states, ballots must be postmarked by Tuesday but might not arrive at election offices until days later. In Georgia’s Senate race, the candidates must win at least 50 percent of the vote to avoid a Dec. 6 runoff.

___

Sara Burnett, Jill Colvin and Will Weissert, Associated Press

Associated Press writers Corey Williams in Southfield, Mich., Anita Snow in Phoenix, Claudia Lauer in Philadelphia and Jacquelyn Martin contributed to this report.