Three wars were fought during this period, the War of Devolution (1667–1668), the Franco-Dutch War (1672–1678), and the War of the Grand Alliance (1688–1697). Although Spain's territorial losses (the Franche-Comté, some towns in the Southern Netherlands and part of the island of Hispaniola) were relatively few, it had demonstrated some vulnerability, and Louis XIV (and indeed the other European rulers) had plans for when Charles II's death came, as it was clear that he would produce no children and the Habsburg line in Spain would die with him. The end came with Charles' passing at the age of 39 on November 1, 1700. Religion and the Spanish Inquisition The Spanish Inquisition was formally launched during the reign of the Catholic Monarchs, continued by their Habsburg successors, and only ended in the 19th century. Under Charles I, the Inquisition became a formal department in the Spanish government, hurtling out of control as the 16th century progressed. Philip II greatly expanded the Inquisition and made church orthodoxy a goal of public policy. In 1559, three years after Philip came to power, students in Spain were forbidden to travel abroad, the leaders of the Inquisition were placed in charge of censorship, and books could no longer be imported. Philip vigorously tried to excise Protestantism from Spain, holding innumerable campaigns to eliminate Lutheran and Calvinist literature from the country, hoping to avoid the chaos taking place in France. Philip was more religious than his father, and was convinced that if the Protestants were resorting to military force, then he must do likewise. He was willing to do whatever it took to fight the heretics and preserve Spanish hegemony, even intervening in papal elections to ensure the choosing of a pro-Spanish pope. Philip succeeded three times with popes Urban VII, Gregory XIV, and Innocent IX. But the fourth time, he failed to prevent the election of the pro-French Clement VIII. The church in Spain had been purged of many of its administrative excesses in the 15th century by Cardinal Ximenes, and the Inquisition served to expurgate many of the more radical reformers who sought to change church theology as the Protestant reformers wanted. Instead, Spain became the scion of the Counter-reformation as it emerged from the Reconquista. Spain bred two unique threads of counter-reformationary thought in the persons of Saint Theresa of Avila and the Basque Ignatius Loyola. Theresa advocated strict monasticism and a revival