The world's second-most visited nation closed its doors and beaches in March to handle the COVID-19 pandemic, imposing a two-week quarantine on overseas visitors. But that requirement will be lifted from July 1, a government statement said.
"The worst is behind us," Foreign Minister Arancha Gonzalez Laya tweeted with emojis of a bikini, sunglasses and a suitcase.
"In July we will gradually open Spain to international tourists, lift the quarantine, ensure the highest standards of health safety. We look forward 2 welcoming you!"
Spain normally draws 80 million people a year with tourism accounting for over 12 percent of gross domestic product and an even bigger share of jobs, so the summer season is crucial to possibilities of mitigating a looming recession.
Bars and restaurants in Madrid and Barcelona were allowed to open outside spaces at half capacity from Monday, but many stayed closed as owners weighed the value of catering to just a few.
Some of those who did open, after gloved and masked staff cleaned terraces and placed tables far apart, were pessimistic.
"It's complicated, we are not going to be able to save the tourist season, unless (enough) foreigners come," said Alfonso Gomez, a restaurant owner in Barcelona.
On the streets, passersby enjoying new-found freedoms were more upbeat. "It's nice just to feel a bit of normality again after so long," said Rosie, a writer and Barcelona resident.
Madrilenos were delighted to be allowed back into the main Retiro park.
"This is great, I was really looking forward to it. And so was my dog!" said interior designer Anna Pardo, walking her pet in the sunshine. Others jogged and chatted in the Retiro's shaded alleys or stopped for a moment to enjoy its lake, still devoid of the usual rowing boats.
While most pupils in Spain still need to study online, some schools reopened in the northern Basque region. Students' temperature was taken as they entered wearing masks.
Spain has recorded 28,752 coronavirus deaths and 235,772 cases, but has seen daily fatalities drop to fewer than 100 for the last week.
The prospect of foreign tourism from July lifted shares of tourism-related stocks, including hotel operator Melia Hotels which rose 14% in early trading.
The tourism and leisure sector tops areas getting most support from state-backed credit lines meant to help businesses. It has received 6.4 billion out of the 38 billion euros ($41 billion) granted over past weeks, according to data from state credit agency ICO.
Jose Carlos Ramon, head of Madrid's restaurants association AMER, said only one in four bars and restaurants in the capital has a terrace and reopening is costly. In Spain as a whole, only about 15% have reopened, he said.
The government was due to discuss on Tuesday how to move on with the gradual phasing out of the lockdown, amid growing tensions between regions and the central government.
The current system might be loosened to allow a more tailored approach for each area. Cabinet was also due to announce 10 days of mourning to honour those dead from the pandemic.