not happy. The Portuguese fluent Philip II visited the country twice, but Philip III only once, in a short formal visit, and Philip IV never bothered to. The Spanish, hard pressed elsewhere, were blamed for inadequately protecting Portugal's overseas colonies from the Dutch (who annexed parts of Colonial Brazil), and in a time of economic downturn, the Spanish colonies did not enjoy having to trade and compete with their Portuguese counterparts. Moreover, Portugal's autonomous status as an equal in the union went into decline after Philip II and was treated increasingly in the great councils of state as a province. After Portugal declared independence and chose the Duke of Braganza as King John IV, Spain was distracted with a Revolt in Andalusia and thus chose to not do anything about it. The Portuguese Revolt was partially what led Spain to conclude peace with France in 1659. But the government had gone bankrupt again in 1647 and 1653, and the nobility wouldn't give an inch on financial and tax reforms. Portuguese victories in 1663 at Ameixial and in 1665 at Vila Viçosa secured their independence, and in 1668 Spain recognized Portugal's sovereignty. Philip IV, who had seen over the course of his life the declining influence of Spain's empire, sank slowly into depression after he had to dismiss his favorite courtier, Olivares, in 1643. In 1646, his eldest son and heir Don Baltasar Carlos died at the age of 16. Charles II was manipulated by various political factions throughout his life. For a short time under Don Juan José de Austria as valido the nobility came to dominate Spain once again. Most were self-serving, but there were a few such as the Count of Oropesa, who managed (despite ruinous deflation) to stabilize the currency. Others tried to weaken the power of the Inquisition (which however was not abolished until 1808) and encourage economic development. Even so, Spain's economy (especially in Castile) declined and its population decreased by nearly two million people during the 17th century. This was partially due to plague outbreaks, and partially due to the huge casualties caused by almost continuous warfare. The period 1677-1686 was a low point, with famine, plague, natural disasters, and economic upheaval. Emigration to the New World increased. France was now strong and united under Louis XIV, and after the Treaty of the Pyrenees (1659) took Spain's place as the dominant power in Europe.