People across Spain have entered lockdown with a nationwide round of applause, from their balconies, to show their gratitude to medical staff working on the front lines of the coronavirus outbreak.

Pedro Sanchez, Spain’s prime minister, gave a televised address on Saturday night announcing measures confining residents to their homes except for essential trips outside.

Minutes later, at 10pm, people in cities as widespread as Madrid, Barcelona, Valencia and Pamplona took to their balconies and leaned from windows to applaud those working in the country’s health services.

Footage of the unprecedented show of appreciation was shared widely on social media, captioned with the words aplauso sanitario, (I applaud the health services) and quedate en casa (stay at home).

It comes after similar isolation measures were introduced in Italy, where residents have been filmed coming together to fill the streets with song from their respective balconies in heartening displays of national unity.

Spain now has more than 6,000 confirmed cases of the virus – the fifth highest number of cases of any other country – after recording a 24-hour rise of at least 1,500 on Friday.

Under the government’s new measures, residents are only allowed to leave their homes to buy food and medicine, commute to work, go to hospitals and banks, or take trips to care for the young and elderly.

All schools and universities are closed, along with restaurants, bars, hotels and other non-essential retail businesses.

“From now we enter into a new phase,” Mr Sanchez told the nation on Saturday night. “We won’t hesitate in doing what we must to beat the virus. We are putting health first.

“We will [eventually] return to the routine of our jobs and again visit our friends and loved ones.

“Until that time comes, let’s not waste energies that are essential now. Let’s not lose our way,” he said, urging all to stay home.

Several fire brigades also shared their appreciation for health care workers at 10pm, sounding their engines’ sirens from fire stations in Madrid and Valladolid, as firefighters lined up to join the applause of nearby residents.

Shouts of “viva los medicos“ (long live doctors) could also be heard ringing through the streets, with some residents also turning the lights on and off in their homes.

Shortly after his announcement, Mr Sanchez’s wife Begona Gomez was revealed to have tested positive for Covid-19.

Both are in good health, according to the government. At least two Cabinet members have also contracted the virus.

A state of emergency has been declared for 15 days. The government had been expected to announce further measures on Saturday to mitigate the economic and social impacts of the crisis, with aid for companies and workers.

But after a seven-hour cabinet meeting, ministers could not agree. Mr Sanchez said the measures would wait until the next meeting, but sought to reassure concerned citizens.

“I want to tell the workers, the self-employed, and businesses that the government of Spain is going to do everything in its power to cushion the effects of this crisis,” Mr Sanchez said.