Treaty of Lisbon (1668)
The Treaty of Lisbon of 1668 was a peace treaty between Portugal and Spain, concluded at Lisbon on 13 February 1668, through the mediation of England, in which Spain recognized the sovereignty of Portugal's new ruling dynasty, the House of Braganza.
The principals 
The regent of Spain, queen Mariana of Austria, second wife of the late King Philip IV, acting in the name of her young son Carlos II, oversaw the negotiation on behalf of Spain. The prince-regent of Portugal, Pedro, future king Peter II of Portugal, in the name of his incapacitated brother, Afonso VI, represented Portugal. The peace was mediated by Edward Montagu, 1st Earl of Sandwich, an ambassador of Charles II of England.
Circumstances of the Portuguese Restoration War 
By 1640, the Habsburg king, Philip IV of Spain (Philip III of Portugal), could no longer count on the trust, support, or loyalty of most Portuguese nobles. The country was overtaxed and Portuguese colonies had been left unprotected. Portugal, like many of Philip’s domains, was on the verge of open rebellion.
After sixty years of living under the rule of Spanish kings, a small band of conspirators in Lisbon rebelled and the Duke of Braganza was acclaimed king of Portugal as John IV on 1 December 1640, taking advantage of a simultaneous revolt in Catalonia and Spain’s continuing conflict with France. This began the 28-year-long Portuguese Restoration War.
In the beginning, Portugal lost many of its colonial possessions to the opportunistic Dutch. Portugal's military strength was reserved for protecting its own frontiers against Spanish incursions; however, after 1648, with the end of the Thirty Years' War, these misfortunes began to reverse. Portugal regained its colonies in Angola, São Tomé, and Brazil by 1654.
In 1652, Catalonia’s rebellion against Spain collapsed, and, in 1659, Spain ended its war with France, so there were grounds for Spanish optimism in the struggle to regain control over Portugal. Yet Portugal could draw on the wealth of Brazil and the aid of (first) France and (then) England, while Spain’s finances were perpetually in crisis.
A series of successes by the Portuguese made it clear that the Iberian Peninsula would not be reunited under Spanish rule. The first of these took place on 8 June 1663, when the count of Vila Flor, Sancho Manoel de Vilhena, with Marshal Schomberg by his side, utterly defeated John of Austria the Younger, an illegitimate son of Philip IV, at the Battle of Ameixial, before retaking Évora, which had been captured earlier that year. One year later, on 7 July 1664, Pedro Jacques de Magalhães, a local military leader, defeated the Duke of Osuna at Ciudad Rodrigo in the Salamanca province of Spain. And finally, on 17 June 1665, the marquis of Marialva and Schomberg destroyed a Spanish army under the marquis of Caracena at the Battle of Montes Claros, followed by defeat at Vila Viçosa.
The Spaniards failed to gain any compensating advantage. Three years later, in 1668, desperate to reduce its military commitments, at almost any price, Spain accepted the loss of the Crown of Portugal and formally recognized the sovereignty of the House of Braganza by signing the Treaty of Lisbon.
Treaty terms 
The fundamental terms of the treaty were:
- The Spanish Habsburgs finally recognized the legitimacy of the Braganza dynasty in Portugal. Infanta Catarina, Duchess of Braganza (1540–1614), former Duchess of Braganza and grandmother of João IV of Portugal, was retrospectively acknowledged as a legitimate heir to the throne.
- Portuguese sovereignty over its colonial possessions was reconfirmed, except for the African exclave of Ceuta, who did not recognize the House of Braganza as the new ruling dynasty.
- Agreements on the exchange of prisoners, reparations, and the restoration of commercial relations were reached.
- Portugal ceded the African city of Ceuta to Spain. Seven years earlier, the nearby city of Tangiers had been awarded to Charles II of England as part of the dowry of Catherine of Braganza; this was stipulated in the Treaty of Lisbon of 1661.
Practical consequences 
The Treaty of Lisbon of 1668 had advantages for both countries. Spain, relieved to be ending a financially ruinous war, was quite pliant in the negotiations. As for Portugal, it was now able to pursue the peaceful possession of its overseas colonies.
After 1668, Portugal, determined to differentiate itself from Spain, turned to Western Europe, particularly France and England, for new ideas and skills. This was part of a gradual "de-Iberianization", as Portugal consolidated its cultural and political independence from Spain. Portuguese nationalism, aroused by success on the battlefield, produced hostile reactions to Spain and to Spanish things and persons. By this time, Portuguese society was composed of two basic elements: those who participated in the gradual Europeanization process, the “political nation,” and those who remained largely unchanged, the majority of the people, who remained apolitical and passive.
Portugal’s restoration of independence freed it to pursue the course mapped out by the pioneers of commercial imperialism. During the seventeenth century, its economy depended largely upon entrepôt trade in tobacco and sugar, and the export of salt. During the eighteenth century, even though staples were not abandoned, the Portuguese economy came to be based more upon slaves, gold, leather, and wine. Portuguese trade, centered in the busy port of Lisbon, was most influenced by Anglo-Dutch capitalism and by the colonial economy in Brazil.
- European Treaties Bearing on the History of the United States and its Dependencies to 1658, ed. Frances Gardiner Davenport
- Jon Cowans (2003). Modern Spain: A Documentary History. U. of Pennsylvania Press. pp. 26–27. ISBN 0-8122-1846-9.
- Portugal by Henry Morse Stephens
- A History of Portuguese Overseas Expansion, 1400–1668 by M. D. D. Newitt
- A History of Spain by Simon Barton
- Economy and Society in Baroque Portugal, 1668–1703 by Carl A. Hanson
- Republican Portugal: A Political History, 1910–1926 by Douglas L. Wheeler
- The Making of Modern Europe, 1648–1780