Britain, Germany and France led the tourist influx.
The sharpest increases were recorded for tourists from the Nordic countries of Denmark, Finland, Iceland, Norway and Sweden as well as from Britain and Russia.
July's figures brought tourist arrivals for the first seven months of the year to a record of 34.0 million, up 3.9 % from the same period last year.
No explanation was given for the increase but it came in a period when rival markets in Egypt and Turkey faced political unrest.
Domestic and international tourism accounts for about 11 % of the Spanish economy, the fourth largest in the euro zone.
The tourism boost will be welcome news for an economy that has been shrinking for two years with official data showing the unemployment rate hit 26.26 %in the second quarter of this year.