Though of ancient origin, Blois is first distinctly mentioned by Gregory of Tours in the 6th century, and the city gained some notability in the 9th century, when it became the seat of a powerful countship known as "Blesum castrum". In 1171, Blois was the site of a blood libel against its Jewish community that led to 31 Jews (by some accounts 40) being burned to death. Their martyrdom also contributed to a prominent and durable school of poetry inspired by Christian persecution. In 1196, Count Louis granted privileges to the townsmen; a commune, which survived throughout the Middle Ages, probably dated from this time. The counts of the Châtillon line resided at Blois more often than their predecessors, and the oldest parts of the château (from the thirteenth century) were built by them. In 1429, Joan of Arc made Blois her base of operations for the relief of Orléans. Joan of Arc rode the thirty-five miles on Wednesday 29 April to Blois to relieve Orléans. After his captivity in England, Charles of Orléans in 1440 took up his residence in the château, where in 1462 his son, afterwards Louis XII, was born. In the 16th century Blois was often the resort of the French court. The Treaty of Blois, which temporarily halted the Italian Wars, was signed there in 1504–1505.