Sept 20 (Reuters) - Spain's trade deficit in the first seven months of the year widened more than five-fold compared to the same period a year earlier to 38.52 billion euros ($38.65 billion), the Industry Ministry said on Tuesday.

Imports rose 40% from the same period a year ago to 261.49 billion euros boosted by oil and gas prices, while exports increased by 24% to 222.96 billion euros, the ministry said.

($1 = 0.9965 euros) (Reporting by Jakub Olesiuk; Editing by Inti Landauro)