WASHINGTON – The Democrats picked up at least two dozen House seats Tuesday and appeared on track to retake control of the chamber, a victory that could put a check on President Donald Trump's agenda over the next two years and trigger a multitude of investigations into his business dealings and administration.

As one of the most volatile midterm elections in U.S. history wound down, the Democrats drew ever closer to the 218 seats needed for a majority, with dozens of races still undecided. A Democratic victory would break the Republicans' eight-year hold on the House that began with the tea party revolt of 2010.

While the Republican Party retained control of the Senate, a win for the Democrats in the House would end the GOP monopoly on power in Washington and open a new era of divided government.

"Tomorrow will be a new day in America," Democratic Leader Nancy Pelosi said at a victory party in Washington.

The campaign unfolded against a backdrop of ugly rhetoric and angry debates on immigration, health care and the role of Congress in overseeing the president.

With the Democratic Party needing a net gain of 23 to take back the House, its candidates flipped seats in several suburban districts outside Washington, Philadelphia, Miami, Chicago and Denver that were considered prime targets for turnover because they were won by Hillary Clinton in 2016. The Democrats also made inroads in Trump country, where they tried to win back white working-class voters.

Midterm elections are typically difficult for the party in power, but the GOP's hold on power was further weakened by an unusually large number of retirements as well as infighting between conservatives and centrists over their allegiance to Trump.

The Democrats, in turn, benefited from extraordinary voter enthusiasm, robust fundraising and unusually fresh candidates. More women than ever were running, along with veterans and minorities, many of them motivated by revulsion over Trump.

As the returns came in, the House was on track to break the record of 84 female members of one party or the other.

In trying to stem Republican losses, Trump made only passing reference to his $1.5 trillion tax cut – the GOP Congress' signature achievement – and instead barnstormed through mostly white regions of the country, interjecting dark and foreboding warnings. He predicted an "invasion" from the migrant caravan making its way toward the U.S. and decried the "radical" agenda of speaker-in-waiting Pelosi.

Trump also took little responsibility for the House, saying his focus was on saving the Senate.

On Tuesday night, he called to congratulate Pelosi and acknowledged her plea for bipartisanship, the leader's spokesman said.

Health care and immigration were high on voters' minds as they cast ballots, according to a ranging survey of the American electorate conducted by The Associated Press. AP VoteCast also showed a majority of voters considered Trump a factor in their votes.

The Democratic candidates tried to stick to an economic message of lowering health care costs and investing in infrastructure to create jobs.

They also promised to clean up government. With control of the House, Democrats will chair powerful committees and have subpoena power to seek Trump's tax returns and more aggressively investigate Russian interference in the 2016 election and whether there was any collusion by the president's campaign.

In the Miami area, former Clinton administration Cabinet member Donna Shalala won an open seat, while GOP Rep. Carlos Curbelo lost his bid for a third term in another district.

In the suburbs outside the nation's capital, Virginia Rep. Barbara Comstock – among the most endangered GOP incumbents, branded Barbara "Trumpstock" by Democrats – lost to Jennifer Wexton, a prosecutor and state legislator.

And outside Richmond, Virginia, one-time tea party favorite Rep. Dave Brat lost to Democrat Abigail Spanberger, a former CIA operative motivated to run for office after the GOP vote to gut the Affordable Care Act. Like other Democrats across the country, Spanberger emphasized protecting people with pre-existing conditions from being denied coverage or charged more by insurers.

Pennsylvania was particularly daunting for Republicans after court-imposed redistricting and a rash of retirements put several seats in play. Democratic favorite Conor Lamb, who stunned Washington by winning a special election in the state, beat Republican Rep. Keith Rothfus in a new district. At least three other red districts flipped to blue.

In Kansas, Democrat Sharice Davids beat a GOP incumbent to become one of two Native American women, with Deb Haaland of New Mexico, elected to the House. Davids is also openly gay.

Democrats welcomed other firsts, including two Muslim-American women, Rhasida Tlaib of Michigan and Minnesota's Ilhan Oman, who is also the first Somali-American elected to Congress. The Republican side of the aisle elected mostly white men.

But in Kentucky, one of the top Democratic recruits, retired Marine fighter pilot Amy McGrath, lost her bid to oust to three-term Rep. Andy Barr in the Lexington-area district.

Republicans had expected the GOP tax plan would be the cornerstone of their election agenda this year, but it became a potential liability in key states along the East and West coasts where residents could face higher tax bills because of limits on property and sales tax deductions.

The tax law was particularly problematic for Republicans in New Jersey, where at least three GOP-held seats flipped. The winners included Democrat Mikie Sherrill, a former Navy pilot and federal prosecutor who ran for a suburban Newark seat.

The GOP campaign committee distanced itself from eight-term Rep. Steve King of Iowa after he was accused of racism and anti-Semitism, but he won anyway.

In California, four GOP seats in the one-time Republican stronghold of Orange County were in play, along with three other seats to the north beyond Los Angeles and into the Central Valley.

"We always knew these races are going to be close," said Rep. Katherine Clark of Massachusetts, co-chair of House Democrats' recruitment efforts. "It's just a very robust class of candidates that really reflects who we are as a country."

___

For AP's complete coverage of the U.S. midterm elections: http://apne.ws/APPolitics . Follow on Twitter at https://twitter.com/lisamascaro and at https://twitter.com/AP_Politics .