We use Chinese customs data to show that unofficial non-tariff barriers were responsible for 50% of the overall reduction in Chinese imports from the U.S. during the height of the U.S.-China trade war in 2018 and 2019. We infer non-tariff barriers from the change in imports of U.S. products relative to imports from other countries of the same HS-6 product, after controlling for the change in the relative price of U.S. imports to the same product sold by other countries. These barriers were imposed on a small number of agricultural products, did not apply to state-owned importers, and were larger for products where the share of state importers in total imports of the U.S. product was large. Non-tariff barriers were responsible for more than 90% of the welfare cost to Chinese consumers of the U.S.-China trade war. The welfare loss to China of a given reduction in imports from the U.S. from non-tariff barriers is about six times larger than an equivalent import decline due to higher tariffs. Non-tariff barriers are more costly compared to tariffs because they applied to some importers and not others, which results in misallocation, and because non-tariff barriers do not generate revenues.