Spain's trade deficit narrowed 49% in the first six months of 2023 from the same period a year earlier to 16.42 billion euros ($17.86 billion), the Industry Ministry said on Thursday.

Imports over the period fell 2.9% to 216.37 billion euros, while exports rose 4.7% to 199.95 billion euros, the ministry said.

Spain's trade deficit widened sharply in 2021 and 2022 as the country relies on imports for all its oil and gas, and prices jumped following the post-pandemic recovery and market turmoil triggered by the war in Ukraine. Prices have since moderated.

The energy trade deficit dropped to 16.70 billion euros from 25.89 billion euros, the ministry said, as the price of energy products in the first six months of the year fell 12% year-on-year, while volumes decreased 18%.

The non-energy trade balance reached a surplus of 285 million euros compared with a deficit of 6.07 billion euros in the same period last year.

The trade deficit in June shrank by 56% to 2.36 billion euros.

($1 = 0.9192 euros) (Reporting by Tiago Brandao Editing by Inti Landauro and Mark Potter)