MADRID — The coronavirus strikes. The patient — at home, sometimes alone — becomes desperately ill. The ambulance finally arrives to take the person away.

Then, a second team, clad in hazmat gear, follows to rescue a household member abandoned in the chaos and suddenly in need of a new caregiver: the patient’s pet.

The teams, from the Madrid animal shelter El Refugio, end up placing the pets in foster homes with people who will care for them temporarily while Spain’s strict lockdown is in place and so much is in flux.

Thousands of animals in Spain have been left behind amid one of the world’s largest and deadliest coronavirus outbreaks — something that has been mirrored around the world, from Wuhan, China, where the pandemic originated, to Israel and India. At the same time, the demand to adopt dogs and cats has surged during the lockdown.