Foreign tourists brought a dose of economic relief to Spain this summer, making it one of the best years ever for the sector which is helping keep the indebted country afloat.
"Spain had one of the best summers in its history for tourism," the government said in a statement.
"In the months of July, August and September, 20.9 million international tourists visited our country, which indicates an 8.5 percent increase compared to summer last year."
In 2011 up to September, the country received 45.8 million tourists, eight percent more than during the same period last year, the tourism ministry statement added.
Britons were the most numerous among these, while large proportions also came from Germany, The Netherlands and France.
The tourism industry benefited early this year as unrest in popular sunspots such as Tunisia and Egypt caused tourists to switch to Spain, and an economic recovery in Germany and other key markets prompted more holidays.
The Canary Islands in the Atlantic Ocean, which offers all-in packages like those available at resorts in Tunisia and Egypt, saw the biggest jump in foreign tourist arrivals: 19.7 percent in January to September, to 7.4 million.
Tourism accounts for about 10 percent of Spain's Gross Domestic Product, acting as a crutch for the country while the Bank of Spain is warning of near-stagnant growth and unemployment is at more than 20 percent.
Spain was the world's fourth most-visited country last year, after France, the United States and China, according to the World Tourism Organisation.
"If we maintain for the rest of the year the overall trend observed up to September, we will end 2011 with about 57 million international tourists visiting our country," the fourth best yearly count ever, the government said.