Protesters trying to save the dog, a mixed breed mutt named Excalibur, scuffled with police as they attempted to stop health department officials from removing the animal from the nurse Teresa Romero's apartment in Alcorcon on the outskirts of the Spanish capital.
Two people were injured as officers carried away some of the dozens of activists who blocked a white veterinary van from entering the gated complex where the apartment is located, according to an AFP photographer at the scene. Police said they had no reports of any injuries.
Just 40 minutes after the dog was removed from the apartment, Madrid's regional government issued a statement saying it had been put down.
The dog had been put to sleep "to avoid suffering," the statement said.
The regional government obtained a court order on Tuesday to euthanise the dog, saying there was a risk it could be "a carrier of the virus even without showing symptoms", and that it could "expel the virus in its fluids with a potential risk of contagion".
- Animal rights protest -
Animal rights groups said there was no evidence that the Ebola virus could be transmitted from dogs to humans.
People for the Ethical Treatment of Animals (PETA) said it was "sad to hear" that the dog had been put down.
"The last thing that this nurse needs is to learn that a family member has been lost, even if, as we all hope, her own life is saved," the director of the British branch of the animal rights group, Mimi Bekhechi, said.
The dog's owner, Romero, in her 40s, was part of a medical team that treated two Spanish priests who were brought back from west Africa for treatment for Ebola but both died.
She was diagnosed with the disease on Monday, becoming the first known case of Ebola being transmitted outside of Africa, where a months-long outbreak has killed nearly 3,900 people and infected at least twice as many.
Her husband, Javier Limon, who has been placed in quarantine as a precaution, contacted Spanish media to object to the decision by Madrid's regional government to have the dog put down.
"The dog is fine. He has the whole house to himself, with the open terrace so he can do his business," he said in a telephone interview with El Mundo newspaper from his hospital room.
He said the dog had no contact with the outside world, had enough food and water inside the apartment to last for several weeks and therefore presented little risk to public health.
"Are they going to put me to sleep, too?" Limon said.
An online petition on the website Change.org, demanding that the dog be put in quarantine instead of being put down, had gathered 374,000 signatures on Wednesday.
"This is not 'just' a dog. For this couple he is one of the family," the petition read.