While the China trade war has clobbered U.S. farmers, it’s been a boon for their northern neighbors.

Canada’s shipments of soybeans to China, the world’s largest buyer, surged to a record 1.23 million metric tons last month, more than four times the amount a year earlier, and up from just over 800,000 tons in December, according to data from the General Administration of Customs on Tuesday. Imports from the U.S. collapsed to 136,000 tons from 5.8 million tons in January last year.

China’s importers, usually processors that crush soybeans into cooking oil and animal feed, have shifted purchases to Canada and Brazil to avoid the 25 percent retaliatory tariffs the country slapped on U.S. farm products last year as the trade conflict intensified. Canada was the biggest shipper of soybeans to China in January after Brazil, which supplied 4.93 million tons.

“The tariff on U.S. crops seems to be the direct reason behind rising imports from Canada,” said Monica Tu, an oilseed analyst from Shanghai JC Intelligence Co. Most of the Canadian purchases were probably made by state-run trading companies for stockpiling, she added.

The spat between the U.S. and China has roiled global trade flows, with the usual routes disrupted as the Asian nation sought supplies from other origins. Still, China has recently been back in the market for U.S. soybeans as a goodwill gesture in talks to resolve the trade dispute.