Spain's Economy Ministry released its trade data on Tuesday. The trade deficit widened to €2.05 billion in June from €1.48 billion in June a year ago.
Exports rose at an annual rate of 7.8% in June, while imports jumped 9.8%.
In the first half of 2015, the trade deficit totalled €11.5 billion, down 3.4% from the same period of 2014.
Exports increased 4.9% in the first half, while imports gained 4.2%.