MADISON, Wis. — Democrats are fighting to beat back Republican gains across the Midwest as the 2018 primary season roars through Wisconsin and Minnesota, two states where President Trump's appeal among working-class voters threaten to upend decades long political trends this fall and beyond.

Tuesday's primary contests for governor, the U.S. Senate and the House will test the strength of Mr. Trump's fiery coalition against the energy of the Democratic resistance. At the same time, accusations of domestic violence involving the Democratic National Committee's second-in-command could undermine the blue wave in Minnesota, a state still healing from scandal.

In all, four states will host primary elections Tuesday as the 2018 primary season nears its final chapter. All but 10 states will have picked their candidates for November's general election by the time all votes are counted in Wisconsin, Minnesota, Vermont and Connecticut. While the full political battlefield isn't quite set, the stakes are clear: Democrats are working to topple Republican control of Congress and governors' offices across the nation.

Get Breaking News Delivered to Your Inbox

Washington state Gov. Jay Inslee, who leads the Democratic Governors Association, predicted that Tuesday would offer fresh evidence of a blue wave that would sweep Democrats into power this November.

"Trump has managed to alienate every form of human life on the planet," Inslee told The Associated Press when asked about his party's appeal among white working-class voters. "They're tired of this chaos."

Democrats appear particularly motivated in Wisconsin, where eight candidates have lined up for the chance to take on Republican Gov. Scott Walker, a two-term incumbent who has warned his party about the prospect of a blue wave.

Walker's strong anti-union policies made him a Democratic villain long before Mr. Trump's rise. State schools chief Tony Evers, who has clashed with Walker at times, enters the primary as the best-known of the eight Democratic candidates.

Once a target of Trump criticism, Walker gained the president's endorsement in a tweet Monday night, Mr. Trump calling him "a tremendous Governor who has done incredible things for that Great State" on the eve of the primary. But Mr. Trump's persistent attacks on Wisconsin-based motorcycle maker Harley-Davidson put Republican candidates on their heels in recent days, Walker among them.

Mr. Trump tweeted Sunday that it was "great" that many Harley owners planned to boycott the Milwaukee company if manufacturing moves overseas, continuing a monthslong tariff dispute with the beloved American motorcycle manufacturer.

Walker avoided addressing the boycott call directly in a written response. His Democratic opponents embraced the fight.

"By attacking Wisconsin workers to cover for failed economic policy, President Trump took a page right out of Scott Walker's playbook," said Mahlon Mitchell, one of the candidates and the head of the state firefighters union.

Mr. Trump also stars, informally at least, in Wisconsin's Senate primaries as Republicans try to deny Democratic Sen. Tammy Baldwin a second term.

The GOP primary features fervent Trump supporters: former Marine Kevin Nicholson, running as an outsider, and longtime state lawmaker Leah Vukmir, who is backed by House Speaker Paul Ryan. While neither candidate was an early Trump supporter, Vukmir has struggled to explain footage recently unearthed from 2016 in which she calls Mr. Trump "offensive to everyone."

Tuesday's primaries serve as a test of Democratic enthusiasm in the upper Midwest, a region that has long been associated with liberal politics but has been trending red. Mr. Trump won Wisconsin by less than 1 percentage point in 2016, becoming the first Republican presidential candidate to carry the state since 1984.

It's much the same in Minnesota, where Mr. Trump lost by less than 3 percentage points in a state that hadn't backed a Republican presidential contender since 1972.

Minnesota voters will pick candidates in competitive races for governor, the Senate and the House. But a down-ballot race for state attorney general may overshadow them all.

Rep. Keith Ellison, the Democratic National Committee's deputy chairman, was expected to capture his party's nomination in the race to become the state's top law enforcement official. That was before Ellison's candidacy was rocked by allegations of domestic violence over the weekend amid a broader national outcry against sexual misconduct by powerful men in business, entertainment and politics.

Ellison has denied an ex-girlfriend's allegations that he dragged her off a bed while screaming obscenities during a 2016 relationship she said was plagued by "narcissistic abuse."

Allegations of misconduct are still fresh in Minnesota, where Democratic Sen. Al Franken resigned in December after multiple allegations of unwanted sexual touching. His replacement, Democratic Sen. Tina Smith, is on Tuesday's ballot as she seeks her first full term. She's facing Democrat Richard Painter, a former George W. Bush ethics lawyer.

Former two-term Republican Gov. Tim Pawlenty may be the biggest name on Minnesota's ballot, however.

He's the leading Republican candidate in the high-profile race to replace outgoing Democratic Gov. Mark Dayton. Having lost his own short-lived bid for president in 2012, Pawlenty spent much of the last six years serving as a top corporate lobbyist.

Like Republican candidates elsewhere, Pawlenty has struggled to live down his blistering critique of Mr. Trump in the weeks leading up to the 2016 election. At the time, he called Mr. Trump "unhinged and unfit for the presidency." Pawlenty has since said he voted for Mr. Trump and supports his agenda.

The Democratic field for governor features U.S. Rep. Tim Walz, state Rep. Erin Murphy and Attorney General Lori Swanson.

Not to be forgotten: Deep-blue Vermont and Connecticut hold primary contests as well.

Vermont Sen. Bernie Sanders, who hasn't ruled out a second presidential run in 2020, is seeking his third term in the Senate. The 76-year-old democratic socialist is running for the Democratic nomination, but he is expected to turn it down and run as an independent.

In Connecticut, five Republicans have lined up to replace the unpopular outgoing governor, Democrat Dan Malloy. The Democratic field features former gubernatorial candidate Ned Lamont and Bridgeport Mayor Joe Ganim, who served several years in prison for political corruption.