In North Dakota, where soybean farmers have struggled with China’s retaliatory tariffs, 93 percent of Republican voters supported the president’s positions on trade, about the national average for Republicans, according to exit polls from CNN.

Nationally, less than a third of all voters said that Mr. Trump’s trade policies had hurt them.

It is impossible to quantify the influence of the president’s trade policies, especially in industrial states like Wisconsin, Pennsylvania and Michigan, in which support for Democrats surged significantly. But Democratic consultants in those states said the tariffs contributed to a general anti-Trump sentiment, but were not a central issue in the midterm elections.

An analysis by The New York Times of election results and economic data showed that Mr. Trump’s party continued to perform strongly in agriculture-rich House districts — which helped create a rural firewall that largely limited the party’s losses to suburban areas. Republicans held onto 17 of the 25 districts that are the most dependent on agricultural jobs. Democrats retained the four they held, with two seats held by Republicans yet to be decided.

Mr. Trump’s overall popularity in rural America seems to be growing — and it seems to have been stoked by the tactic, employed by China and other trading partners, of targeting retaliatory tariffs at Trump-friendly districts.

“I think our pain definitely has a purpose,” said Doug Schroeder, a corn and soybean farmer from Mahomet, Ill., a district that voted Republican on Tuesday. “I don’t think the balance of trade with China has been fair for a long time. Someone needed to stand up and do something.”

In Washington State’s Fourth Congressional District, which includes much of the state’s wine-producing region, Representative Dan Newhouse, the Republican incumbent, defeated his challenger by 28 points on Tuesday. Two years ago, in a far more Republican-friendly environment over all, Mr. Newhouse won by just 16 points.

The expansion of the Republican majority in the Senate, and the failure of the tariffs to ignite a political brush fire, is likely to embolden Mr. Trump as he contemplates additional tariffs on all Chinese imports before he meets with President Xi Jinping of China this month in Buenos Aires.