Following the confiscation of the possessions of Jacques d'Armagnac, duke of Nemours, to which the countship of Castres had passed, it was bestowed in 1476 by King Louis XI on Boffille de Juge (Boffillo del Giudice), an Italian nobleman and adventurer serving as a diplomat for Louis XI, but the appointment led to so much disagreement (family feud between Boffille de Juge, his only daughter, and his brother-in-law) that the countship was united to the crown by King Francis I in 1519. Around 1560, the majority of the population of Castres converted to Protestantism. In the wars of the latter part of the 16th century the inhabitants sided with the Protestant party, fortified the town, and established an independent republic. Castres was one of the largest Protestant strongholds in southern France, along with Montauban and La Rochelle. Henry of Navarre, leader of the Protestant party, who later became King Henry IV of France, stayed in Castres in 1585. The Protestants of Castres were brought to terms, however, by King Louis XIII in 1629, and Richelieu came himself to Castres to have its fortifications dismantled. Nonetheless, after these religious wars, the town, now in peace, enjoyed a period of rapid expansion. Business and traditional commercial activities revived, in particular fur and leather-dressing, tanning, and above all wool trade. Culture flourished anew, with the founding of the Academy of Castres in 1648. Castres was turned by the Catholic Church into an active center of Counter-Reformation, with the establishments of several convents in town, and the building of a renowned bishop's palace by Mgr. Tubœuf, still the most famous monument in town today. A new cathedral was also built, after the destructions of the religious wars. Perhaps even more important, Castres was made the seat of the "Chambre de l'Édit" of the Parliament of Toulouse, a court of justice detached from the Parliament of Toulouse and in charge of dealing with the cases involving the Protestants of Languedoc, a measure of protection granted to them by the Edict of Nantes. This court attracted lots of business to Castres. In 1665, there were 7,000 inhabitants in Castres, 4,000 of whom Catholic, and 3,000 Protestant. In 1670 however, the "Chambre de l'Édit" was transferred to Castelnaudary, much to the discontent of even the catholic citizens of Castres, who lost a major source of business and revenue with the departure of the lawyers and the plaintiffs.