CONCORD — New Hampshire set a record for exports for 2018, the second consecutive year Granite State goods reached an all-time high in international trade.

According to federal trade data released by the state Monday, New Hampshire exports totaled more than $5.2 billion for 2018, an increase of 2.68 percent from the previous record of $5.1 billion set in 2017.

“International trade is a growing component of our state’s economy and this trade data reinforces the work we are doing to improve access for New Hampshire businesses in international markets,” Taylor Caswell, commissioner of the state Department of Business and Economic Affairs, said in the news release.

Industrial machinery accounted for the largest chunk of New Hampshire exports last year at $1.2 billion, an increase of nearly 8 percent from the previous year. Caswell said the state has seen significant growth in aerospace and life-science sectors along with an increase in global demand for Granite State products.

Germany took over as New Hampshire’s top international trading partner, unseating neighboring Canada, while Ireland, Mexico and China rounded out the top five, according to the news release.

Aircraft and spacecraft parts exports increased more than 68 percent from 2017, totaling $841 million, the news release said. Pharmaceutical products shot up 22 percent for $411 million, according to the news release.

New Hampshire businesses have capitalized on international trade opportunities, allowing the companies a broader customer base through overseas markets, Gov. Chris Sununu said.

New Hampshire exports posted a record value for the second straight year and third time in five years. The record total has also increased by nearly $1 billion since the 2014 mark of $4.23 billion.

“From aerospace to the life sciences, New Hampshire is home to companies at the pinnacle of innovation,” Sununu said. “Throughout the last two years, we have focused on implementing a pro-growth agenda that opens doors of opportunity for companies not just in New Hampshire, but across the nation and the world — and the new record-setting export numbers prove it’s working!”