WASHINGTON—The standoff between Washington and Beijing has cost China its position as the U.S.’s top trading partner, a shift that could accelerate as President Trump moves to ratchet up tariffs even more.

Data released Friday showed that Mexico was the top trading partner for the first half of the year, followed by Canada. Imports from China dropped by 12%, and U.S. exports to China fell 19%, as tit-for-tat tariffs and other barriers imposed by Washington and Beijing took their toll.

“These...