In the 7th Century someone decided he must have been to Spain at some time as an evangelist, which entitled him to be Patron of Spain. We’re not sure where that idea came from, but perhaps it was divine inspiration.
He was given the emblem of a scallop shell and was often depicted as a pilgrim with a staff.
In 844 he miraculously appeared to help the Spaniards defeat the Moors in the battle of Clavijo. Obviously he believed that old story about him going to Spain, so it must be true after all.