That represented a 0.4 percent increase when compared with the figure of the first quarter, when Spain's economy grew by 2.7 percent on a year-on-year basis.
The figures meant that Spain's economic growth has returned to pre-crisis levels thanks to a rise in domestic demand.
Household consumption rose by 3.5 percent and non-profit institutions and public administration consumption rose by 1.6 percent and 1 percent respectively, the INE said, while investment rose by 6.1 percent.
The INE reported that exports increased by 6 percent and imports by 7.2 percent, while employment rose by 2.9 percent on a year-on-year basis creating around 477,000 new jobs.
Spain's economy has been growing for seven consecutive months on a year-on-year basis, meanwhile, on a quarterly basis the Spanish gross domestic product (GDP) grew by 1 percent, a 0.1 percent up in comparison with the first quarter.
According to the INE, domestic demand also rose on a quarterly basis helping the country's GDP to grow more than in previous quarters.
Household consumption increased by 1 percent in the second quarter, 0.3 percent more than in the first quarter, and non-profit institutions and public administration consumption rose by 0.2 percent and 0.4 percent respectively. Employment rose by 0.9 percent, the INE said.
Meanwhile, imports rose by 2.3 percent and exports increased by 1.6 percent.
Spanish government expects a GDP growth of 3.3 percent for 2015 and 3 percent for 2016.