By Giovanni Legorano in Rome and María Martínez in Barcelona

A surge in new coronavirus cases in Spain is threatening the recovery of the country's vital tourism sector and underscoring the fragility of the hard-fought gains in bringing the virus under control in a country that was among the hardest hit in the West earlier this year.

The increase in infections -- and the U.K.'s abrupt decision to impose a two-week quarantine on travelers arriving from Spain -- points to the economic cost if the virus begins to spread widely again as Europeans begin to shop, dine out and travel over the summer and fall following lengthy lockdowns in the spring.

Shares in European airlines fell sharply Monday after the British quarantine decision, with markets rattled by worries that the European tourist season -- which had only recently started to recover -- may suffer another hit. EasyJet PLC dropped 8%, Deutsche Lufthansa AG lost 5% and Ryanair Holdings PLC shed 3.9%.

TUI U.K., part of tour operator TUI, said it would cancel all holidays to mainland Spain until Aug. 9 because of the new quarantine requirements imposed on travelers returning from Spain, which the U.K. said was needed to stem a rise of infections there. It made its move after Spain's national health ministry reported 2,255 new cases on Friday, following its report of 2,615 new cases on Thursday. On Monday, Spain said new cases swelled to 6,361 between midday Friday and the same time Monday.

"I understand that it is disruptive for those who are going through this who are in Spain or who have been considering going to Spain but we must be able to take swift, decisive action to protect the U.K.," British Foreign Secretary Dominic Raab said in comments broadcast on Sky News on Sunday.

The Spanish government defended the country as a safe holiday destination where the epidemic is under control, and has been attempting to negotiate a quarantine waiver for British tourists returning from holidays in Balearic and Canary Islands, two popular destinations. The U.K.'s Department of Transport didn't respond to a request for comment.

"Spain is a safe country. Like other European countries it has new outbreaks. This isn't unusual," said Foreign Affairs Minister Arancha González on Sunday. "The most important thing is that Spain is making big efforts to control these outbreaks, a big effort to identify coronavirus cases."

Spanish health authorities are blaming the behavior of Spanish youths as one of the main reasons for the recent surge in new infections.

"Certain generations haven't remained vigilant," said Fernando Simón, director of the center for health alerts and emergencies at the Ministry of Health, referring to the increase in cases among young people attending social gatherings or taking part in the country's nightlife.

Mr. Simón added that other cases were imported by temporary workers or by international tourists.

The Spanish Health Ministry said that the situation in the country hasn't differed from other countries.

"The virus isn't circulating only in Spain, but everywhere. In almost all countries around us there are outbreaks of major or minor relevance. What matters is keeping new cases under control," the ministry said in a reply to a request for comment.

Belgian authorities, for example, will tighten their coronavirus restrictions beginning Wednesday, limiting households to seeing only five other people for the next four weeks after 2,000 new cases emerged last week -- a 71% increase from the week before. Currently, individuals in households are each allowed to meet 15 people a week, and those people could change from one week to another.

"The epidemiological figures are worrying and we are all worried," said Prime Minister Sophie Wilmès after a meeting of the National Security Council, saying she doesn't rule out keeping schools closed after the summer break if the contagion doesn't subside. Belgium had one of the highest Covid-19 mortality rates in the world earlier in spring, despite a strict lockdown.

Spain had high hopes that the high tourist summer season would help recover some of its economic losses this year. The economy shrank by 17% in the second quarter of the year, according to European Union estimates, the worst contraction among the larger European countries. The tourism sector, which accounted for 14% of Spain's gross domestic product last year and provides a similar proportion of the country's jobs, was preparing for a rebound from the loosening of travel restrictions in the EU. That is now in jeopardy.

"The U.K. decision is an absolute disaster for Spain's economic recovery, " said Ángel Talavera, an economist at Oxford Economics. "Even if it was going to be a reduced season, there were hopes some of it could be salvaged and help a recovery in the third quarter."

Hotel Yaramar on the coast of Spain's southern Andalusia region was among the businesses hoping to benefit. The four-star hotel opened last week after being shut for much of the year and of its 500 rooms, 19% were booked for the rest of July and 37% for August.

"The summer was going better than expected," said Alberto Pino, the hotel's restaurant manager.

The U.K.'s quarantine decision will likely stem the flow of guests. "We are a hotel centered on British tourists," Mr. Pino said, adding that 85% of their clientele comes from the U.K.

With summer hopes fading, the hotel is already refocusing on the winter season, when the share of British tourists typically rises to 90% as they escape the rain and cold of the U.K.

"The summer season is almost lost, but we hope we will have a stronger winter," Mr. Pino said.

Valentina Pop in Brussels contributed to this article.

Write to Giovanni Legorano at giovanni.legorano@wsj.com