The sweeping tariffs that former President Donald J. Trump imposed on China and other American trading partners were simultaneously a political success and an economic failure, a new study suggests. That’s because the levies won over voters for the Republican Party even though they did not bring back jobs.

The nonpartisan working paper examines monthly data on U.S. employment by industry to find that the tariffs that Mr. Trump placed on foreign metals, washing machines and an array of goods from China starting in 2018 neither raised nor lowered the overall number of jobs in the affected industries.

But the tariffs did incite other countries to impose their own retaliatory tariffs on American products, making them more expensive to sell overseas, and those levies had a negative effect on American jobs, the paper finds. That was particularly true in agriculture: Farmers who exported soybeans, cotton and sorghum to China were hit by Beijing’s decision to raise tariffs on those products to as much as 25 percent.

The Trump administration aimed to offset those losses by offering financial support for farmers, ultimately giving out $23 billion in 2018 and 2019. But those funds were distributed unevenly, a government assessment found, and the economists say those subsidies only partially mitigated the harm that had been caused by the tariffs.

The findings contradict Mr. Trump’s claims that his tariffs helped to reverse some of the damage done by competition from China and bring back American manufacturing jobs that had gone overseas. The economists conclude that the aggregate effect on U.S. jobs of the three measures — the original tariffs, retaliatory tariffs and subsidies granted to farmers — were “at best a wash, and it may have been mildly negative.”

“Certainly you can reject the hypothesis that this tariff policy was very successful at bringing back jobs to those industries that got a lot of exposure to that tariff war,” one of the study authors, David Dorn of the University of Zurich, said in an interview.

Even so, the researchers’ work suggests that aggressive tariffs on foreign products were a political success for Mr. Trump and the Republican Party.

Drawing from data on vote counts for presidential and congressional elections, the study suggests that people living in areas affected by the tariffs — particularly the Midwest, the area around the Great Lakes, and the South — became more likely to vote to re-elect Mr. Trump in 2020. They also became less likely to identify as Democrats, and more likely to elect Republicans to Congress, according to the paper.

Those political beliefs were not entirely immune to economic effects: Republican electoral gains were stronger in locations where tariffs and subsidies had a more positive effect on the job market. And the retaliatory tariffs that other countries imposed in response to Mr. Trump’s levies did weaken support for Republicans, but only modestly, the paper said.

Still, the economists speculate that voters in areas that were hit hard by economic competition from China in past decades may have valued the tariffs “as a sign of political solidarity,” rather than for the actual consequences they had on jobs.

“People react very positively, positively from a Republican point of view, to import protection of their local industry,” Mr. Dorn said, “but they don’t punish Republicans that much if their location gets exposed to retaliatory tariffs.”

In addition to Mr. Dorn, the study’s authors are David Autor of the Massachusetts Institute of Technology, Anne Beck of the World Bank and Gordon H. Hanson of the Harvard Kennedy School.

Mr. Autor, Mr. Dorn and Mr. Hanson have conducted influential research on “the China shock,” which quantified how much China’s joining the World Trade Organization had reduced U.S. manufacturing employment. Their later work examined how those job losses have influenced political trends in the U.S. heartland, including leading to political polarization and increased Republican support.

Mr. Dorn said that the American economy was growing strongly during the trade war, which may have influenced voters’ perceptions of the effects that tariffs had. “It’s the famous, ‘It’s the economy, stupid,’” he said.

“It is very, very difficult for people to sort of fully isolate why the economy is going well,” Mr. Dorn added. “Is the economy going well because of some particular government policy, or is the economy going well despite the government policy?”

The findings come as Mr. Trump is promising even more aggressive trade measures as a candidate in 2024. Mr. Trump has proclaimed his previous tariffs a success and proposed to issue an even more expansive program of levies if re-elected, including a 10 percent “base-line” tariff on all imported goods.

Both Democrats and Republicans have shown an increased willingness to embrace protections for American industry in recent years, after decades in which trade rapidly expanded, supply chains globalized and many U.S. factories shifted overseas.

While Mr. Biden has reduced some of the tariffs Mr. Trump put into effect, for example those on Europe, he has kept the China tariffs and other measures in place. Biden administration officials are also debating raising tariffs on some strategic products, like electric vehicles, further.

Proponents argue that tariffs deter China from flooding the United States with cheap goods, protecting vulnerable American manufacturing industries and generating revenue for the federal government.

Critics say tariffs simply raise prices for American consumers and pose a particular burden for lower-income people who spend more of their money on goods. Tariffs also increase costs for American factories that depend on foreign inputs, which can make U.S. products more expensive and less competitive internationally.

During Mr. Trump’s tenure, the average U.S. tariff on Chinese goods jumped from 3.1 percent to 21 percent within just two years, while the average Chinese tariff on U.S. goods rose from 8 percent to 21.8 percent, the study says.

The study authors say it is not clear precisely why import tariffs did not result in more U.S. jobs. One possibility is that firms simply imported products from other lower-cost countries, rather than China, a trend that is visible in trade data.

In some cases, Mr. Dorn said, U.S. industries that received import protection ended up having higher sales; one possibility is that American firms found that they could raise their prices after tariffs were imposed without raising their output.

It remains an open question whether tariffs that failed to generate substantial job gains during the trade war might create more jobs over longer periods, the paper said.