The U.S. just lost a trade battle with Mexico. It's the first loss of the Trump era.

Mexico and the U.S. have fought for years over tuna. The U.S. insists that any Mexican tuna sold in the U.S. must be "dolphin safe," meaning dolphins weren't killed by tuna fisherman, which was once common. Mexico says its fisherman play by the rules. The U.S. government disagrees.

On Tuesday, the World Trade Organization ruled in Mexico's favor, allowing it to impose trade sanctions worth $163 million a year against the U.S. The WTO says that's how much money Mexico has lost from the U.S. unfairly penalizing Mexican tuna.

U.S. officials criticized the ruling.

"We are disappointed in the WTO Arbitrator's decision regarding U.S. dolphin-safe labeling standards," a spokesperson for the U.S. Trade Representative, a wing of the executive branch, said in a statement.

The Trump administration argues that the WTO ruling didn't take into account updated US laws on "dolphin safe" tuna, and that it overstated the actual financial loss to Mexican tuna producers, who the USTR accused of intentionally chasing and netting dolphins.

Related: Trump imposes 20% tariff on Canadian lumber

The timing, however coincidental, is sensitive. President Trump wants to renegotiate NAFTA, the free trade agreement between the U.S., Mexico and Canada.

Trump's administration took its first steps to crack down on trade with Canada on Monday night when the Commerce Department announced a 20% tariff against Canadian softwood lumber. A war of words between Canadian and American leaders has followed.

Trump's decision to go after Canada first with tariffs was particularly surprising given his harsh criticism of Mexico on the campaign trail. Now Trump has upset Canada and suffered a trade defeat from Mexico.

Related: Trump has done a big flip-flip on Wall Street

Mexican officials insisted for years that U.S. laws discriminated against their tuna, and that other countries didn't face the same level of enforcement. They argued that they have upheld international standards on commercial fishing and environmental preservation.

Tuesday's ruling by the WTO ends a case that was first filed by Mexico in 2008.

Mexico's economic ministry said it would immediately take actions to reclaim the $163 million the WTO said it had lost from the U.S. restrictions. It didn't say whether its retaliatory actions would be tariffs on U.S. tuna or another product.