Louis XIV succeeded his father at four years of age; he would go on to become the most powerful king in French history. His mother Anne served as his regent with 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.