WASHINGTON (AP) — The energy and outrage of the Democratic resistance faced off against the brute strength of President Donald Trump's GOP on Tuesday as voters across America decided whether Democrats should control at least one chamber of Congress for the first time in the Trump era.

Fundraising, polls and history were not on the president's side. But two years after an election that proved polls and prognosticators wrong, an air of uncertainty — and stormy weather across parts of the country — clouded the outcome of high-stakes elections from Florida to Alaska and everywhere in between.

The first polls are set to close across parts of Kentucky and Indiana at 6 p.m. ET.

Anxious Republicans privately expressed confidence in their narrow Senate majority but feared the House was slipping 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 39 million Americans have already voted, either by mail or in person, breaking early voting records across 37 states, according to an AP analysis.

Trump encouraged voters to view the first nationwide election of his presidency as a referendum on his leadership. With the economy surging, he also 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 Trump campaign advertisement off the air on the eve of the election, determining its portrayal of a murderous immigrant went too far.

The president's current job approval, set at 40 percent by Gallup, was the lowest mark of any first-term president in the modern era. Both Barack Obama and Bill Clinton's numbers were 5 points higher at the same period, and both suffered catastrophic midterm losses of 63 and 54 House seats respectively.

Democrats need to pick up two dozen seats on Tuesday to seize the House majority and two seats to control the Senate.

All 435 seats in the U.S. House are up for re-election, although fewer than 90 were considered competitive. Another 35 Senate seats are in play, as are almost 40 governorships and the balance of power in virtually every state legislature.

Democrats, whose very relevance in the 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.

Jay Hutchins, a 49-year-old Democrat who voted in the Washington suburb of Silver Spring, Maryland, is among those dissatisfied with Trump and the Republican-led Congress.

"I'm not pleased with Trump's leadership at all. I think he's trying to divide this country," said Hutchins, acting executive director of a group that advocates on labor issues. "I think he's preying upon people's fears. I think we need a president and leadership that appeals to the better angels of folks. I don't think Trump has done that at all."

But in Ohio, Judy Jenkins, a 60-year-old Republican, said she was voting exclusively for GOP candidates. She said she used to vote for candidates from both major parties, but vowed never to support a Democrat because she was so upset by how new Supreme Court Justice Brett Kavanaugh was treated in his confirmation process. She also backs Trump and said Republicans are moving in the right direction on health care.

Republicans "have actually brought the change," she said. "That's why our economy is growing like it is. They may not be perfect, but who is?"

The political and practical stakes were sky-high.

Democrats could derail Trump's legislative agenda for the next two years should they win control of the House or the Senate. Perhaps more important, they would claim subpoena power to investigate 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.

Tuesday's elections also test the strength of a Trump-era political realignment defined by evolving divisions among voters by race, gender and especially education.

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.

The demographic divides were coloring the political landscape in different ways.

Democrats are 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 Trump's turbulent presidency, despite the strength of the national economy.

Democrats face a far more difficult challenge in the Senate, where they are almost exclusively on defense in rural states where Trump remains popular. Democratic Senate incumbents are up for re-election, for example, in North Dakota, Indiana, and Missouri — states Trump carried by almost 25 percentage points on average two years ago.

Democrats also boast record diversity on the ballot.

Three states could elect their first African-American governors, while several others are running LGBT candidates and Muslims. A record number of women are also running for Senate, House, governorships and state legislative seats.

Meanwhile, Trump and his chief lieutenants offered a fiery message in the election's final hours.

"Republicans create jobs. Democrats create mobs," Republican National Committee chair Ronna Romney McDaniel tweeted.

___

Associated Press writers Eric Tucker in Washington, Kantele Franko in Westerville, Ohio and Michael Kunzelman in Silver Spring, Maryland contributed to this report.

For AP's complete coverage of the U.S. midterm elections: http://apne.ws/APPolitics

Copyright 2018 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.