WASHINGTON — Democrats were gaining significant ground in the battle for House control Tuesday night, while Republicans held onto their majority in the Senate as voters weighed in on the first nationwide election in President Donald Trump's presidency.
With control of Congress, statehouses and the president's agenda at stake, some of the nation's top elections were too close to call.
Democrats won half the seats they needed to claim House control with dozens additional competitive contests remaining. Victories in contested races across Florida, New York, Virginia, Pennsylvania and Minnesota gave them cause for optimism.
The Democrats' narrow path to the Senate was slammed shut after setbacks in Indiana, Tennessee, North Dakota and Texas.
President Trump's team immediately sought to give him credit for retaining their narrow Senate majority, even as their foothold in the more competitive House battlefield appeared to be slipping.
"It's a huge moment and victory for the president," Press Secretary Sarah Huckabee Sanders told reporters at the White House Tuesday night.
Two issues more than any others were on voters' minds. 25 percent described health care and immigration as the most important issues in the election, according to AP VoteCast, a national survey of the electorate. Nearly two-thirds said President Trump was a reason for their vote.
Democrats, whose very relevance in the President Trump era depended on winning at least one chamber of Congress, were laser-focused on health care as they predicted victories that would break up the GOP's monopoly in Washington and state governments.
The political and practical stakes were sky-high.
Democrats could derail President Trump's legislative agenda for the next two years should they win control of the House. And they would claim subpoena power to investigate President Trump's personal and professional shortcomings.
Some Democrats have already vowed to force the release of his tax returns. Others have pledged to pursue impeachment, although removal from office is unlikely so long as the GOP controls the Senate or even maintains a healthy minority.
Yet President Trump's party will maintain Senate control for the next two years, at least.
In Texas, Sen Ted Cruz staved off a tough challenge from Democrat Beto O'Rourke, whose record-smashing fundraising and celebrity have set off buzz he could be a credible 2020 White House contender.
In Indiana, President Trump-backed businessman Mike Braun defeated Democratic incumbent Joe Donnelly. And in Tennessee, Congresswoman Marsha Blackburn defeated former Gov. Phil Bredesen, a top Democratic recruit.
In the leadup to the election, Republicans privately expressed confidence in their narrow Senate majority but feared the House could slip away. The GOP's grip on high-profile governorships in Florida, Georgia and Wisconsin were at risk as well.
Long lines and malfunctioning machines marred the first hours of voting in some precincts, including in Georgia, where some voters reported waiting up to three hours to vote in a hotly contested gubernatorial election. More than 40 million Americans had already voted, either by mail or in person, breaking early voting records across 37 states, according to an AP analysis.
Nearly 40 percent of voters cast their ballots to express opposition to the president, according to AP VoteCast, the national survey of the electorate, while one-in-four said they voted to express support for President Trump.
Overall, 6 in 10 voters said the country was headed in the wrong direction, but roughly that same number described the national economy as excellent or good.
President Trump encouraged voters to view the first nationwide election of his presidency as a referendum on his leadership, pointing proudly to the surging economy at recent rallies.
He bet big on a xenophobic closing message, warning of an immigrant "invasion" that promised to spread violent crime and drugs across the nation. Several television networks, including the president's favorite Fox News Channel, yanked a President Trump campaign advertisement off the air on the eve of the election, determining that its portrayal of a murderous immigrant went too far.
The president's current job approval, set at 40 percent by Gallup, was the lowest at this point of any first-term president in the modern era. Both Barack Obama's and Bill Clinton's numbers were 5 points higher, and both suffered major midterm losses of 63 and 54 House seats respectively.
Democrats needed to pick up two dozen seats to seize the House majority and two seats to control the Senate.
Democratic Sens. Joe Manchin in West Virginia and Tammy Baldwin in Wisconsin won re-election. And in New Jersey, Democrats re-elected embattled Sen. Bob Menendez, who, less than a year ago, stood trial for federal corruption charges. The Justice Department dropped the charges after his trial ended in an hung jury.
Democrats' performance in the House battlefield was mixed.
In Virginia, political newcomer Jennifer Wexton defeated two-term GOP Rep. Barbara Comstock. The Republican incumbent had been branded Barbara "Trumpstock" by Democrats in a race that pointed to Trump's unpopularity among college-educated women in the suburbs.
In south Florida, former Health and Human Services Secretary Donna Shalala defeated Republican Maria Elvira Salazar.
Democrats failed to defeat a vulnerable incumbent in Kentucky, where Republican Rep. Andy Barr won over former Marine fighter pilot Amy McGrath.
All 435 seats in the U.S. House were up for re-election, although fewer than 90 were considered competitive. Some 35 Senate seats were in play, as were almost 40 governorships and the balance of power in virtually every state legislature.
Meanwhile, several 2020 presidential prospects easily won re-election, including Sens. Bernie Sanders of Vermont, Elizabeth Warren of Massachusetts, Sherrod Brown of Ohio, Sen. Kirsten Gillibrand of New York and New York Gov. Andrew Cuomo.
President Trump spent the day at the White House, tweeting, making calls, monitoring the races and meeting with his political team.
He and the first lady were to host an evening watch party for family and friends. Among those expected: Vice President Mike Pence and former House Speaker Newt Gingrich, an informal adviser to the president.
Tuesday's elections also tested the strength of a President Trump-era political realignment defined by evolving divisions among voters by race, gender, and especially education.
President Trump's Republican coalition is increasingly older, whiter, more male and less likely to have a college degree. Democrats are relying more upon women, people of color, young people and college graduates.
Women voted considerably more in favor of their congressional Democratic candidate — with fewer than 4 in 10 voting for the Republican, according to VoteCast, a nationwide survey of more than 113,000 voters and about 20,000 nonvoters — conducted for The Associated Press by NORC at the University of Chicago.
In suburban areas where key House races will be decided, voters skewed significantly toward Democrats by a nearly 10-point margin.
The demographic divides were coloring the political landscape in different ways.
Democrats were most optimistic about the House, a sprawling battlefield set largely in America's suburbs where more educated and affluent voters in both parties have soured on President Trump's turbulent presidency, despite the strength of the national economy.
Democrats faced a far more difficult challenge in the Senate, where they were almost exclusively on defense in rural states where President Trump remains popular. Democratic Senate incumbents were up for re-election, for example, in North Dakota, Indiana, and Missouri — states President Trump carried by almost 25 percentage points on average two years ago.
History was working against the president in the Senate: 2002 was the only midterm election in the past three decades when the party holding the White House gained Senate seats.
Democrats boasted record diversity on ballots.
Three states could elect their first African-American governors, while several others were running LGBT candidates and Muslims. A record number of women were running for Senate, House, governorships and state legislative seats.