due to lack of resources and the disruption caused by the 1639 to 1642 Piedmontese Civil War. Victory at Orbetello in June 1646, and the recapture of Naples in 1647 left Spain firmly in control of this region. The 1648 Peace of Westphalia ended the Thirty Years War and recognised Dutch independence, ending the drain on Spanish resources. Under the October 1648 Treaty of Münster, France gained strategic locations in Alsace and Lorraine, as well as Pinerolo, which controlled access to Alpine passes in Northern Italy. However, the peace excluded Italy, Imperial territories in the Low Countries, and French-occupied Lorraine; although Emperor Ferdinand agreed to remain neutral, fighting continued. Phase II: 1648 to 1659 After declaring bankruptcy in 1647, in order to reduce expenditure Philip prioritised retaking Catalonia while remaining on the defensive elsewhere. In addition, many of his best troops had been lost at Rocroi and parts of Flanders overrun, including the key port of Dunkirk, a centre for Spanish privateer attacks on Dutch and French shipping. However, his position improved after the Peace of Westphalia ended the Dutch war, while political and economic turmoil in France led to civil war or Fronde. Philip initially hoped simply to improve the terms on offer from France, but the Fronde allowed him to make substantial gains in the Netherlands, including retaking Ypres. Elsewhere, neither side was able to win a significant advantage; in 1650, Spanish success in crushing the Neapolitan Revolt was offset by the loss of Barcelona to French backed Catalan rebels. Mazarin forced Condé into exile in the Spanish Netherlands in 1651, where his immense prestige in territories adjacent to the Spanish possession of Franche-Comté made him a valuable ally for Philip. Over the course of 1652, Spain recaptured both Dunkirk and Barcelona, and although limited combat continued in Roussillon, by 1653 the front had stabilised along the modern Pyrenees border. However, doing so forced Philip into bankruptcy again, while the end of the Fronde allowed Mazarin to resume attacks on Milan, possession of which would allow France to threaten Habsburg Austria. The attempt failed despite support from Savoy, Modena and Portugal. By now, the two antagonists were exhausted, with neither able to establish dominance; from 1654 to 1656, major French victories at Arras, Landrecies and Saint-Ghislain were offset by Spanish victories at Pavia and Valenciennes. Under pressure from the Pope, Mazarin offered peace terms but refused to accept