Originating as vassals of the Frankish kings,[1] the hereditary counts ruled the city of Toulouse and its surrounding county from the late 9th century until 1270.[2] They reached the zenith of their power during the 11th and 12th centuries, but after the Albigensian Crusade the county fell to the kingdom of France, nominally in 1229 and de facto in 1271.During the youth of young Louis the Pious his tutor, Torson (sometimes Chorso or Choson), ruled at Toulouse as the first count.In 788, Count Torson was captured by the Basques under Adalric, who made him swear an oath of allegiance to the Duke of Gascony, Lupus II.His rule, however, was disturbed by the ambition of William IX and his granddaughter, Eleanor of Aquitaine, who urged her husband Louis VII of France to support her claims to Toulouse by war.Following the 1208 assassination of the Papal legate, Pierre de Castelnau, Raymond was excommunicated and the County of Toulouse was placed under interdict by Pope Innocent III.Only in 1681, Toulouse was resurrected as a royal appanage by Louis XIV for his illegitimate son with Françoise-Athénaïs, marquise de Montespan, Louis-Alexandre.