Treasury Secretary Steven Mnuchin has reportedly encouraged the president to reach a deal with China quickly and avoid political blowback from a trade war in 2020. (Jabin Botsford/The Washington Post)

President Trump’s aggressive trade policies are running headlong into his campaign for reelection.

As Trump prepares to run on the economy, his threat to increase tariffs on imports from China has sent the stock market diving and undercut a stretch of positive economic news. U.S. farmers and exporters, already bearing the brunt of China’s retaliatory tariffs, now face the prospect of an escalated trade war in which states that Trump needs to win reelection will be in the crosshairs.

The trade war has also exposed a rift inside the White House and among the president’s allies — with some officials pushing for a quick resolution to calm the markets ahead of 2020, and others warning the president that a weak deal with China could leave him politically vulnerable.

“My warning has been: We don’t want the 2020 election year to become greatly intensified friction with China over trade issues. We want a deal that works,” said Michael Pillsbury, a China expert at the Hudson Institute who has advised the Trump administration on trade. “One way to unite all 21 Democratic primary candidates is if the president gets a quick but flawed deal that inevitably leads to friction when China is caught cheating next year.”

However, Treasury Secretary Steven Mnuchin and National Economic Council Director Larry Kudlow are among a group of Trump aides who have encouraged the president to reach a deal with China quickly and avoid political blowback from a full-scale trade war in 2020, according to people familiar with the internal debate.

White House officials said Trump is prepared to take a hard line with China going into 2020 in part because he intends to keep his 2016 campaign promise to fix what he views as bad trade deals. Trump believes strongly in the power of tariffs to force China and other countries to negotiate and won’t sign a deal for political expediency, said two officials, who spoke on the condition of anonymity to discuss internal strategy.

The two officials also played down the extent of disagreement within the administration, saying top advisers are mostly in agreement about the need to take on China over its unfair trade practices.

Trump’s trade agenda is likely to play a central role in the 2020 race, as Democrats seek to challenge his economic message and compete with him in export-reliant states such as Wisconsin, Michigan and Pennsylvania. The president is also struggling to build support in Congress for his renegotiated version of the North American Free Trade Agreement, with some Republican lawmakers objecting to the continued use of tariffs on steel and aluminum imports from U.S. allies.

Some Democratic presidential candidates are using the turbulence around the trade talks to needle Trump and try to undercut his messaging on the economy.

“This is what happens when he tries to go at it alone and he has no leverage,” Sen. Kamala D. Harris (D-Calif.) said in an interview. “So he has to create this kind of leverage through a tweet. We should be sitting at that table with our allies.”

Trump campaign officials recently polled trade messaging in a multistate survey, according to people familiar with the matter. Trade and immigration are likely to be two themes on which the president focuses as he ramps up his campaign in the coming months, officials said.

Trade talks between the United States and China faltered this week as Trump publicly voiced his frustration by announcing plans for new tariffs on Chinese goods.

“The Trade Deal with China continues, but too slowly, as they attempt to renegotiate,” Trump tweeted Sunday, after threatening to levy tariffs on all imports of Chinese goods. “No!”

U.S. officials accused China of reneging on prior commitments in the talks, which have included 10 rounds over the past year. In meetings in Washington and Beijing, the Trump administration has been pushing for significant concessions from the Chinese on issues including market access, intellectual property rights and the trade deficit.

Robert E. Lighthizer, the president’s chief trade negotiator, told reporters Monday that although Chinese officials had walked back their previous commitments, the United States was still planning to move forward with talks. The administration expects to host Chinese Vice Premier Liu He to continue discussions in Washington this week.

Trump has credited his previous tariffs with bringing Beijing to the table, but China has retaliated by slapping tariffs on U.S. agricultural products. Those tariffs and other retaliatory levies from the European Union, Canada and Mexico have sent economic shock waves through communities that helped Trump secure his 2016 victory.

Republican lawmakers have increasingly voiced concerns to the White House about the president’s trade policy and the impact of tariffs on their states.

Although many praise Trump for his tough-on-China stance, they also say that patience is wearing thin and that the president risks losing the backing of farmers in key presidential swing states.

“If he gets a deal, awesome. If he doesn’t, it’s going to hurt,” said Sen. Joni Ernst (R-Iowa), who is up for reelection next year in a state that Trump won in 2016. Farmers are “losing their patience, yeah, but they want to see a deal.”

Senate Majority Whip John Thune (R-S.D.) said that Republican senators have tried to make the political argument against tariffs but that it seemed to fall on deaf ears.

“I just think he believes that farmers are going to be with him because they think he’s doing the right thing,” Thune said. “And by and large, that’s true. But when you start losing the farm, that calculation starts to change a little bit.”

When Vice President Pence attended the Senate GOP lunch Tuesday, he got an earful from senators who complained about the political ramifications of Trump’s trade approach, said Sen. Pat Roberts (R-Kan.).

“There’s a lot of feeling in farm country we’re being used as pawns in this whole business,” he said. “We will benefit tremendously if we get a good deal, so we’re hanging in there with the president. As opposed to hanging separately.”

Pence encouraged the senators to stick with Trump, who has publicly complained about a lack of unity in his party as he tries to negotiate trade agreements.

Trump’s campaign advisers expressed confidence that the president’s trade policies will help him connect with voters in Rust Belt states that have lost manufacturing jobs to China.

“Unlike his predecessors, President Trump has demonstrated that he has the courage to take on China’s unfair trade practices,” Trump campaign spokeswoman Kayleigh McEnany said in a statement that singled out former vice president Joe Biden for saying China was “not competition” for the United States. “While other administrations have talked a good game about confronting China, President Trump has been working on a deal to stop China from stealing intellectual property, forcing transfer of technology, manipulating currency, and dumping steel into the market.”

Trump had previously said that trade talks were going well and that he was on track to hold a face-to-face meeting with Chinese President Xi Jinping to finalize the deal. Those positive comments coincided with a soaring stock market in recent weeks.

But White House officials said Trump has grown frustrated at times that a deal with China has not been struck. Once he received word from trade officials in recent days that talks were unlikely to come to a resolution soon on terms the United States wanted, he decided to impose new tariffs, thinking that doing so would force China back to the table.

One official said Trump is aware that he needs a deal before 2020 to hold on to support from farmers in the Midwest.

The president repeatedly boasts to advisers that his tough approach is hurting the Chinese economy — and that Beijing’s standing in the world is falling — even as some officials and advisers close to him worry that the Chinese are negotiating from a stronger position politically. But there is also disagreement within the White House about how much economic pain the United States can stomach before the trade battles blow back on the president politically.

“They’re scared of the market going down, since it could undercut the president’s claim of boosting the economy so much,” Pillsbury said.

The Dow Jones industrial average fell 473 points, or 1.8 percent, on Tuesday as investors weighed the prospect of Trump’s following through on his threat to increase tariffs from 10 percent to 25 percent on $200 billion in Chinese goods. Trump has closely watched the markets and tracked the impact of his policies on stocks.

The president has claimed that the strong economy gives him leverage to push for a comprehensive deal with China. The U.S. economy grew in the first quarter at a surprisingly robust rate of 3.2 percent, and the unemployment rate fell last month to its lowest point in nearly 50 years.

Dan DiMicco, a former steel executive and trade adviser to Trump’s 2016 campaign, said the president’s base wants him to maintain a tough position on trade, even if it causes some short-term economic head winds.

“He believes that this trade issue is as important as the economy because they’re totally related,” he said. “He’s going to be running on both.”

Josh Dawsey, Ashley Parker and Erica Werner contributed to this report.