President Donald Trump praised the revenue raised by his tariffs on $250 billion worth of Chinese goods.

"The United States Treasury has taken in MANY billions of dollars from the Tariffs we are charging China and other countries that have not treated us fairly," Trump tweeted.

It is true that the Treasury Department collected $6.2 billion in tariff revenue in October, double the amount that was generated during the same month in 2017.

But Trump's celebration is misguided because US importers and American consumers are the ones effectively paying for the tariffs.

President Donald Trump painted a rosy picture of the trade war with China on Thursday, once again touting the large amount of tax revenue generated by his tariffs.

"The United States Treasury has taken in MANY billions of dollars from the Tariffs we are charging China and other countries that have not treated us fairly," Trump tweeted. "In the meantime we are doing well in various Trade Negotiations currently going on. At some point this had to be done!"

The Treasury Department has indeed brought in double the amount of tax revenue from import duties since the tariffs were put in place.

According to an analysis of Treasury Department data by Tariffs Hurt the Heartland, an anti-tariff group, the Treasury Department collected about $6.2 billion worth of customs duties in October — the first full month after Trump's tariffs on $200 billion worth of goods went into effect. That number is double the tariff revenue that was collected in October 2017.

But Trump's celebration doesn't take into account who is effectively paying that money.

Chinese exporters do not pay the tariffs. Rather, US importers pay the cost of the duties when the goods come into American ports. Howard Gleckman, a senior fellow at the Tax Policy Center, explained the process in a September article about the mechanics of tariffs.

"A tariff is a tax on imported goods. Despite what the President says, it is almost always paid directly by the importer (usually a domestic firm), and never by the exporting country," Gleckman wrote. "Thus, if the US imposes a tariff on Chinese televisions, the duty is paid to the US Customs and Border Protection Service at the border by a US broker representing a US importer, say, Costco."

Facing a higher cost for the imported goods, US importers can decide to either absorb the increased costs into their margins — thus lowering profits and possibly forcing cost cuts elsewhere — or pass on the cost increases on to consumers to make up the difference.

"A business will, if it can, pass its higher after-tax costs on to consumers," Gleckman wrote. "Thus, the price of Chinese TVs sold in the US may rise rapidly."

So while the Treasury Department may be collecting more tax revenue because of the tariffs, most of the money is ultimately coming from US businesses and American consumers, rather than from China.

Read more: Trump's trade war with China is the biggest threat to the US economy in 2019, and it's making economists the most worried they've been in years

Ian Shepherdson, the chief economist at Pantheon Macroeconomics, highlighted this problem in a December note to clients after Trump's tweet in which he dubbed himself "Tariff Man." The economist said some Chinese exporters may be forced to take lower margins to get their product to the US, but also asserted that American consumers would be the biggest losers.

"Tariffs are a tax on consumers, primarily, though some of the hit might be borne by Chinese exporters, forced to accept lower margins. But for the president to boast that the U.S. is 'taking in billions' on tariffs makes no sense at all," Shepherdson wrote. "The ostensible objective of the tariffs is to force China to negotiate a new trading relationship with the US, not to raise money — from U.S. consumers! — for the federal government."