A flock of over 1,000 sheep wandered away from their shepherd in Huesca after he fell asleep. Police later found the shepherd and helped guide the flock out of the city shortly after. (Policia Local Huesca)

The backstory behind the ambling flock of sheep that amassed in the Spanish city of Huesca resembles a New Testament fable: a lone shepherd, responsible for 1,300 sheep, dozed off and his flock scattered. But unlike the days of the first century, there were police around to awaken the embarrassed shepherd, help corral the sheep and clear the roadways for morning commuters.

The sheep were first reported about 4:30 a.m. Tuesday, the Telegraph reports, when a local resident noticed the bleating bunch. After herding the sheep out of Huesca, a city in Spain’s northeastern autonomous region of Aragon, the shepherd headed north along a historic herding route to the Pyrenean uplands for the summer.

Although surprising in the time of sprawling metropolises and endless highways, Spain’s shepherding tradition has survived for centuries — largely because of the work of defiant shepherds. Every year, shepherds lead herds of thousands of sheep through the streets of Madrid to practice their ancient rights of seasonal livestock migration and grazing, known as “Cañada Real.” The event is part festival, part defensive protest.

And while the number of Spanish shepherds is dwindling, a school has sprung up in Catalonia, a region of Spain that borders Aragon, to train a new generation of shepherds as the familial tradition lags. Hopefully the program teaches new shepherds how to stay awake.