PIPERTON, Tenn. — President Trump’s trade war has handed Democratic candidates a cudgel in their effort to retake the Senate, forcing their GOP opponents into uncomfortable decisions about how closely to align with a polarizing president.

Democratic candidates in Tennessee, North Dakota, Missouri and elsewhere have campaigned on their opposition to Trump’s trade efforts and warned of coming economic damage. Several have engaged in high-profile events with sympathetic figures hurt by Trump’s tariffs, accusing their rivals of being complicit in the president’s policy.

The tariffs, and Democratic messaging concerning them, present GOP candidates with a complicated calculus: stand with Trump and support a policy that may threaten their constituents’ livelihoods or break ranks on trade with a president who is strongly backed by the party’s voters.

In Tennessee, Democrat Phil Bredesen aired an early campaign ad touting his opposition to the tariffs.

He was in Piperton, a half-hour drive east of Memphis in Tennessee farm country, to talk trade with pig farmers, soybean growers and others. He heard complaints about the increased costs of farm equipment because of Trump’s tariffs on steel and aluminum — as well as fears of Chinese retaliation.

In a post-event interview, he accused his Senate rival, GOP Rep. Marsha Blackburn, of “reflexive” support for the president.

Blackburn has made her alliance with Trump central to her campaign, but she has deviated on trade. Her campaign declined to make her available for an interview but released a statement criticizing the tariffs. “This approach to tariffs is a bad deal for Tennesseans,” read a part of the statement. “While it’s about time we had a president who will stand up to bad trade deals, we should use a more narrowly tailored approach that protects American exports and punishes bad actors.”

In May, when Trump threatened to impose tariffs on foreign automobiles, raising alarms in a state full of automakers, Blackburn was less unequivocal. “We are watching it very closely,” she told the Chattanooga Times Free Press.

Blackburn’s campaign disputes that there was any initial hesitancy on her part in opposing Trump’s tariffs, but Bredesen says his opponent waffled. “When they first came out, her reflexive idea was to support the president,” Bredesen told The Washington Post. “I suspect that as she’s seen that these really are hurting people, that she’s finding a way to distance herself from that view.”

Democrats in other states have attempted Bredesen’s strategy. Sen. Heidi Heitkamp (N.D.) has emphasized her opposition to the tariffs, telling voters that other nations’ retaliation will hurt sales for the state’s many farmers.

Her opponent, Rep. Kevin Cramer (R), has stood with Trump on tariffs, even after that stance was part of what cost him the support of the billionaire GOP donor Koch brothers. (The Koch network is backing Blackburn in Tennessee.)

In Missouri, Sen. Claire McCaskill, another vulnerable Democratic incumbent, recently toured a nail factory that had laid off employees in response to the tariffs and posed with workers. Her November opponent, state Attorney General Josh Hawley, has backed Trump’s effort to renegotiate trade deals.

The United States is in trade disputes with China, Mexico, Canada, the European Union and other countries, as Trump follows through on campaign promises by slapping duties on foreign goods and demanding trade deals be renegotiated. He says the tariffs are part of a broader effort to win better trade terms for U.S. businesses. For now, they’ve raised prices on some goods and been met with retaliatory taxes from trading partners that threaten to cause U.S. farmers, manufacturers and other firms to lose business overseas.

In Tennessee, Trump struck a nerve with on-again, off-again threats to impose tariffs on foreign automobiles, which would slam a state where Volkswagen, Nissan and other automakers and parts manufacturers employ tens of thousands of workers.

Sen. Bob Corker, the retiring Republican whom Blackburn and Bredesen are battling to replace, has been a vocal opponent of the tariffs. But he’s retiring amid speculation he would struggle to win a GOP primary, in part because of his frequent fights with the president. Corker got a talking-to from Senate Majority Leader Mitch McConnell (R-Ky.) after praising Brede­sen warmly and struggling to say anything nice about Blackburn, whom he’s endorsed.

Recent polling on the race is scarce, but surveys have generally shown it is close. A Mason-Dixon poll in April put Bredesen at 46 percent and Blackburn at 43 percent.

Trump won Tennessee by 26 percentage points in 2016, and other than the split over trade, Blackburn has closely tied her campaign to the president.

“Tennessee needs a senator who is going to support President Trump,” a narrator said in a recent campaign ad that consisted entirely of footage of Blackburn and Trump together at a rally.

Blackburn has served in the House since 2003 and has burnished her conservative credentials with frequent appearances on Fox News and by chairing a select committee that investigated Planned Parenthood.

Some doubt she can keep her distance from Trump’s trade policy while running as a Trump Republican.

“Her argument is not very effective because she wants to continue to support the president, but this is not a winning issue in Tennessee,” said John G. Geer, a professor of public policy at Vanderbilt University in Nashville. “Blackburn is a little boxed in.”

Bredesen, a mild-mannered 74-year-old who cut a bipartisan image as governor from 2003 to 2011 and remains widely popular, faces his own struggles finding the right distance from his national party.

He has promised to work with Trump on some issues and oppose him on others, and in an interview, he distanced himself from Senate Minority Leader Charles E. Schumer (D-N.Y.), declining to commit to supporting him for Democratic Senate leader.

At a roundtable in Piperton, he went so far as to predict Democrats would not retake the Senate, aiming to quiet concerns that a vote for him was a vote for a Democratic takeover.

“I have a lot of these conversations which are ‘Oh, I love you, you’re a great governor, but I don’t want the Democrats to have a Senate majority,’ ” Bredesen said. “But when I look at it realistically — and I’m sure that a bunch of them are hoping for it — I just can’t see it happening.”

As the Democrat works to keep the focus on trade, the potential of his approach was apparent in conversations with Tennessee voters — but so were its limits.

Willie German, who introduced himself as a cotton, corn and soybean farmer as well as a Fayette County commissioner, said the trade war is already hurting farmers.

“What he’s doing probably needs to be done, and it’s probably going to get better — but it’s probably going to kill us for the next year or two,” German said, referring to Trump.

The group was mostly made up of Republicans because that’s all that’s left in Fayette County, McCall Wilson, chief executive of the Bank of Fayette County, said in an interview later. The bank hosted the roundtable.

“I’ve always liked Bredesen. He was a very moderate governor; he was a very, very good governor,” Wilson said. “Marsha’s just kind of far right; she’s not my choice for U.S. Senate.”

Other voters questioned whether voting for a Democrat was a bridge too far, even if they were frustrated about trade.

Sam Goff, 67, a Republican and businessman who cast his ballot in early voting in Memphis last month, called Trump’s tariffs “disastrous,” saying, “Look at what’s already happening.”

Goff, who is himself running for county commissioner, said he was struggling over whom to back in the Senate race.

“I don’t think either choice is easy for me,” he said. “One’s too extreme; one’s too soft. . . . I’m a moderate Republican. [Bredesen] might be too Democrat for me.”

But when questioned about how trade played into the equation, Goff suggested the issue might help sway his vote toward Bredesen.

“You’re really hitting on my quandary here, aren’t you?” he said.

For others, though, trade is not going to be the issue that decides their votes.

Scott Rhea, who farms 5,500 acres in Somerville, attended Bredesen’s event in Piperton and said later that he liked the former governor and shared some of the views he’d expressed on tariffs.

“I feel like the people that are going to be hurt the most by the tariffs are the farmers,” Rhea said.

Trump’s promised $12 billion bailout for farmers has not won him over: “I would rather have a fair market, fair trade,” Rhea said. “And I think most farmers that I know would agree with me.”

Yet for Rhea, all that might not be enough. As much as he likes Bredesen, he said he’s reluctant to give his vote to a Democrat — any Democrat. The viewpoint underscores Bredesen’s uphill challenge in a red state, even one on the front lines of Trump’s trade war.

“I’m very fond of Governor Bredesen, he was a wonderful governor, and I think he’ll be a great senator,” said Rhea, who described himself as a conservative, antiabortion Christian. “I just don’t know if I can vote for the Democratic Party.”