CHICAGO (Reuters) - A private importer in China last week bought U.S. rice for the first time ever, in the midst of a trade war between the two nations, a rice industry group said on Wednesday.

The Chinese importer bought two containers, about 40 tonnes, of medium-grain rice from California-based Sun Valley Rice, said Michael Klein, a spokesman for USA Rice, a trade group that promotes the sale of the U.S. grain.

The U.S. rice was milled and packaged into bags for consumer and food service use, Klein said.

China was a major buyer of U.S. soybeans and pork before the trade war started by the Trump administration. U.S. President Donald Trump said on Monday that China had agreed to make unspecified new purchases of U.S. farm products after he met with Chinese President Xi Jinping, but purchases of major export crops have so far been elusive.

It was not immediately clear whether the rice purchase was a goodwill gesture following the Trump-Xi meeting. The rice deal follows a sale of 544,000 tonnes of U.S. soybeans to China confirmed last week by the U.S. Department of Agriculture, the largest such sale since March.

China is the world’s largest rice grower and consumer, producing 148.5 million tonnes of the grain in the 2018/19 marketing year and importing 3.5 million tonnes.

The United States produced 7.1 million tonnes of rice in 2018/19 and exported less than 3 million tonnes.

Chinese officials agreed to allow imports of U.S. rice in July 2017, following years of negotiations. But a nearly year-long trade dispute between the two countries threatened the first sale.

“It looked dicey for us for a while, with the hostility going back and forth ... We were about to have a market, and saw it snatched away, or so we thought,” Klein said.

Sun Valley Rice hopes the deal lays the groundwork for more sales of U.S. rice to China in the future, representatives said.

“Sun Valley has been a leader when it comes to agriculture trade with China, we have been taking the first steps,” said Karen Leland, Sun Valley’s chief marketing officer.