As the story goes, back in the middle ages the people of Barcelos were deeply concerned about an unsolved crime. When a stranger from Galicia arrived in town, claiming to be en route to Santiago de Compostela in Spain, the finger of blame was pointed at him. He, of course, protested his innocence but he was sentenced to death by hanging. In a bid to avoid this fate, he begged to see the judge who had passed the sentence.
The judge happened to be eating dinner with some friends when the Galician arrived. The condemned man pointed to a roasted cockerel on the dinner table and declared that “It is as certain that I am innocent as it is certain that this rooster will crow when they hang me.” Needless to say, he was laughed out of the room and dragged off to his fate.
The official and his friends decided against eating the bird but they were still taken aback when the cockerel actually stood up and crowed, proving the man’s innocence. Realizing his mistake, the judge rushed to the gallows to try and prevent the innocent man from being hanged. By the time he arrived, however, the Galician was dangling from a rope. Luckily, the knot had been badly tied, saving the man’s life. The judge ordered him to be cut down immediately and freed.