Spain's Economy Ministry released its trade data on Thursday. The trade deficit widened to €3.19 billion in August from €2.77 billion in August a year ago.
Exports declined at an annual rate of 0.8% in August, while imports rose 1.5%.
In the January to August period, the trade deficit totalled €16.07 billion, down 2.5% from the same period of 2014.
Exports increased 4.9% in the January to August period, while imports gained 4.2%.