Heathrow's Terminal One was typically busy yesterday. British Airways' flights for Madrid were, as usual for a Friday, heavily booked. But the type of passengers travelling to the Spanish capital was sharply different from the norm. Porters pushed trolleys overloaded with television news equipment through the crowds, while journalists received instructions from their editors via mobile phones. The world's media was converging on Madrid.

Spare seats to Spain's capital were not difficult to find. Many of the usual weekenders had cancelled their short breaks in Madrid rather than trespass on the city's grief. BA, like easyJet - the other big UK airline serving Spain - is allowing passengers booked to Madrid between now and the end of the month to change their plans without charge. What worries the airlines, the UK holiday companies and the Spanish tourist officials, is the effect of Thursday's carnage on prospective visitors.

Since a German tour operator built the first modern hotel in Benidorm in 1957, Spain has become the mainstay of the package holiday industry. Franco realised that providing cheap, cheerful and sunny vacations for northern Europeans was an engine that could drag Spain out of the economic morass in which it had been mired since the Civil War.

After the death of the dictator and the restoration of democracy, tourism accelerated and diversified. In 1992, the Olympics were staged in Barcelona, the World Expo took place in Seville and Madrid reigned as European Capital of Culture. Since then, the number of cheap flights has risen at an astonishing rate: there are more than 20 per day between London and Madrid. The Spanish capital has become a leading short-break destination for the British, as has the Basque capital, Bilbao, because of the Guggenheim. Those visits helped boost UK tourism to Spain to 13 million last year, overtaking the traditional favourite, France.

The immediate effect of Thursday's attack is evident in the empty hotels and restaurants in Madrid. Longer term, the consequences will depend on who is found to be responsible for the atrocity. Tourism is highly susceptible to perceptions of a risk of terrorism - a fact first appreciated by the Shining Path guerrillas in Peru in the 1980s. The Maoist terrorists murdered only a handful of tourists, but publicity about their campaign slowed the inflow of visitors to a trickle. Subsequent attacks on tourists in Egypt, Bali and Kenya wrought severe damage to those economies.

The Basque terrorist group, Eta, has conducted a low-level campaign targeting Mediterranean tourist destinations for some years. The impact on visitor confidence has been negligible, but if Eta are responsible for Thursday's carnage, millions of tourists may stay away.

"I don't think anything else could have been thrown at us," said Peter Long, the chief executive of First Choice, on Tuesday. He is one of the most respected figures in the travel industry, and was commenting on "two years of sustained grief" in the mainstream package holiday business. At least his company's aircraft can be flown to destinations regarded by the travelling public as safer than Spain. If Eta is deemed to be responsible, the real economic losers will be the hotel and restaurant workers on the costas and in the cities.

From the Spanish economic perspective, the lesser of two appalling evils is that al-Qa'ida rather than Eta will be deemed responsible. For holidaymakers and long-term residents in the Balearics, the Costa del Sol and the Canaries, an attack on rush-hour Madrid seems a world away and presents no imminent threat of further action. But for the travel industry globally, placing responsibility for the attack on al-Qa'ida is an even worse scenario.

As with 11 September 2001, the repercussions of the tragedy will reverberate more widely than the city under attack. Americans, who once spent more than anyone else in many countries around the world, will become even more reluctant to leave their shores. A generalised sense of heightened risk will depress the demand for travel. And top of the list of countries regarded as a target for al-Qa'ida, and therefore worth avoiding, will be Britain.