Minnesota farms, factories and mines exported a record $21.4 billion worth of goods in 2014 amid a surge of orders from Mexico and Japan, state officials said Friday.

Total exports jumped 2.9 percent from 2013, with Canada remaining the state’s largest trading partner with $5.6 billion in purchases.

Mexico leapt up the list, becoming the state’s second-largest customer with $2.24 billion in orders. Mexican companies were particularly aggressive during the fourth quarter, buying $625 million worth of Minnesota goods, compared with $186 million for the same period one year ago.

Growth was so strong that Mexico surpassed China, which placed third on the list by buying $2.2 billion in goods last year.

The state’s other critical trading partners included Japan ($1.2 billion), Belgium ($886 million), Germany ($749 million), South Korea ($712 million), Philippines ($571 million) and Singapore ($531 million).

Katie Clark Sieben, commissioner of the Minnesota Department of Employment and Economic Development, noted that the state’s efforts to encourage small and medium-sized manufacturers to export appears to be paying off.

“More than 8,600 Minnesota companies are exporting, most of them small and medium-sized businesses,” Sieben said.

The state’s agricultural, mining and manufacturing sectors shipped 930 different types of products to 192 countries between Oct. 1 and Dec. 31. There was a higher demand globally for Minnesota-made optical and medical products, machinery, plastics and wood.

Economists and U.S. commerce officials long have praised exports for keeping Minnesota’s economy afloat during the Great Recession and since.

The state opened numerous trade offices in Asia, Europe, South and Central America in an effort to beef up commerce and create new markets for Minnesota-made goods. Such efforts produced steady progress.

During the fourth quarter, the state saw notable increases for grains, seeds and cereals from Mexico, China, Israel, Indonesia and Algeria. Exported car parts, plastics and aircraft parts rose during the quarter while orders for machinery and food byproducts fell.