Spain, where tourism accounts for around 10 percent of the economy, has enjoyed a surge in international visitors to its cities and beaches in recent years partly due to security concerns in other popular sunshine destinations in the Middle East and North Africa.
The country surpassed the United States last year to become the world's second most visited country after France as the number of arrivals in 2017 - 82 million - beat records for the fifth straight year.
Visitor numbers to Spain fell 4.9 percent to just under 10 million in July over the same month last year, figures released by national statistics institute INE showed, the first drop during the key summer holiday month since 2009.
The number of Britons visiting fell by 5.6 percent, with the weak pound making it more expensive to visit eurozone nations like Spain.
Nevertheless, Britons remained the largest contingent of tourists to visit Spain during July.
Foreign visitor numbers during the first seven months of the year inched up by just 0.3 percent to 47 million, compared to the double-digit growth recorded in 2016 and 2017.
Prime Minister Pedro Sanchez shrugged off the decline in visitor numbers in July during an interview with radio Cadena Ser, saying arrivals numbers overall were still "historically high".
Package holiday giant Thomas Cook said last month that it has seen a 63 percent increase in bookings for Turkey from last year, with Antalya now its most popular airport for British holidaymakers.
It said it had moved capacity east from Spain for summer 2018 to Turkey, Tunisia and other Mediterranean markets as Spain was becoming more expensive by comparison.