MADRID - Spain's exports grew for the ninth straight year in 2018, reaching another record, but the trade deficit widened as energy imports surged, provisional data from the industry ministry showed on Thursday.

Spain's trade deficit rose 36.8 percent in 2018 from a year earlier to 33.8 billion euros ($38.4 billion), as exports rose 2.9 percent to 285 billion euros and imports rose 5.6 percent to 318.9 billion euros.

"2018 ended with growth amid an international context of uncertainty and slowdown, both in terms of growth and trade", junior minister for commerce Xiana Mendez said to journalists on Thursday.

Exports increased in all areas but vehicles, which dropped 1.5 percent because of lower sales to markets such as Germany, France and Turkey, Industry Minister Reyes Maroto said.

However, energy imports rose 18.3 percent last year, meaning energy products accounted for some 25.1 billion euros of the total trade deficit, the figures showed.

($1 = 0.8808 euros)

(Reporting by Jose Elias Rodriguez; editing by Paul Day, Larry King) ((paul.e.day@thomsonreuters.com; +34 91 585 21 51; Reuters Messaging: paul.e.day.thomsonreuters.com@reuters.net))