How did the body of St. James end up in Galicia at Santiago de Compostela?

Each year on the 30th of December, Spain celebrates the miraculous translation of St. James from Jerusalem to the shores of Galicia.