her favorite Jules, Cardinal Mazarin, as chief minister. At age 7 Nicolas V de Villeroy became the teacher of the young king. The main childhood places of Louis XIV were the Palais-Royal and the nearby Hôtel de Villeroy. Mazarin continued the policies of Richelieu, bringing the Thirty Years' War to a successful conclusion in 1648 and defeating the nobility's challenge to royal absolutism in a series of civil wars known as the Frondes. He continued to war with Spain until 1659. In that year the Treaty of the Pyrenees was signed signifying a major shift in power, France had replaced Spain as the dominant state in Europe. The treaty called for an arranged marriage between Louis and his cousin Maria Theresa, a daughter of King Philip IV of Spain by his first wife Elisabeth, the sister of Louis XIII. They were married in 1660 and had a son, Louis, in 1661. Mazarin died on 9 March 1661 and it was expected that Louis would appoint another chief minister, as had become the tradition, but instead he shocked the country by announcing he would rule alone. For six years Louis reformed the finances of his state and built formidable armed forces. France fought a series of wars from 1667 onward and gained some territory on its northern and eastern borders. Maria Theresa died in 1683 and the next year he secretly married the devoutly Catholic Françoise d'Aubigné, Marquise de Maintenon. Louis XIV began to persecute Protestants, undoing the religious tolerance established by his grandfather Henry IV, culminating in his revocation of the Edict of Nantes in 1685. The last war waged by Louis XIV proved to be one of the most important to dynastic Europe. In 1700, King Charles II of Spain, a Habsburg, died without a son. Louis's only legitimate son, the Grand Dauphin, as the late king's nephew, was the closest heir; and Charles willed the kingdom to the Dauphin's second son, the Duke of Anjou. Other powers, particularly the Austrian Habsburgs, who had the next closest claims, objected to such a vast increase in French power. Initially, most of the other powers were willing to accept Anjou's reign as Philip V, but Louis's mishandling of their concerns soon drove the English, Dutch and other powers to join the Austrians in a coalition against France. The War of the Spanish Succession began in 1701 and raged for 12 years.