Villach received market rights in 1060, though it was not mentioned as a town in records until about 1240. The parish church dedicated to St. James was first documented in 1136. Emperor Frederick II conferred the citizens the right to hold an annual fair on the feast of 25 July ("Jakobitag") in 1222. The 1348 Friuli earthquake devastated large parts of the town, another devastating earthquake occurred in 1690. There were also several fires in Villach, which destroyed many buildings. The first documented mayor took office in the 16th century.