In the city centre, long queues of owners and pets stretched to the doors of the Church of Saint Anthony, patron saint of animals.
"Through Saint Anthony, receive this blessing," intoned 70-year-old priest Manuel Perez as he sprinkled drops of holy water on a terrier puppy.
Owners come for the blessing so their pets will be "cared for from here to up there," said 21-year-old model Alvaro Lopez, with his long-nosed, racoon-like coati.
Nearby the waiting pets, another queue of people waited outside a separate church door to buy buns, traditionally kept alongside a coin in a cupboard to be eaten on the feast of Saint Anthony the following year, supposedly to ensure good health and to gain the blessing of the saint.
The buns are baked according to a secret recipe meant to keep them soft for longer.
The festival has been celebrated in Madrid since the 19th century and is held in other parts of Spain such as the Balearic Islands in the Mediterranean and the northern city of Burgos.
Animals are said to have been drawn to Saint Anthony throughout his life.
Born in Lisbon, Portugal in 1195, the saint is often depicted addressing a menagerie of animals attentively listening to his words.