Tourists and city-dwellers were surprised to see the capital's traffic cut to permit the bleating, bell-clanking parade to pass the city's most emblematic locations.
Shepherds halted at the old town hall so the chief herdsman could hand authorities 10 maravedies copper coins first minted in the 11th century as payment for the crossing.
They then continued past Puerta del Sol Madrid's equivalent of New York's Times Square and past the Bank of Spain headquarters on their way to Retiro Park.
Since medieval times, shepherds have had the right to use droving paths crisscrossing a landscape that was once a checkerboard of woodland and grazing space.
More From This Section
Some herding routes have been used annually for over 800 years and Madrid sprawls across one dating back to 1372. Madrid became an important urban center when King Philip II chose it as the capital of his vast empire in 1561.
The herd was accompanied by musicians and dancers dressed in regional costumes that have been worn by rural workers for centuries.