When Philip II of Portugal died, he was succeeded by his son Philip III, who had a different approach to Portuguese issues. Taxes on the Portuguese merchants were raised, the Portuguese nobility began to lose its influence and government posts in Portugal were increasingly occupied by Spaniards. Ultimately, Philip III tried to make Portugal a Spanish province, meaning Portuguese nobles stood to lose all of their power. This situation culminated in a revolution organized by the nobility and the bourgeoisie, executed on 1 December 1640, fifty-nine years after the accession of Philip II of Spain to the throne of Portugal. A plot was planned by several associates, known as the Forty Conspirators, who killed the Secretary of State, Miguel de Vasconcelos, and imprisoned the king's cousin, Margaret of Savoy, the Vicereine of Portugal, governing the country in the King's name. Philip's troops were at the time fighting the Thirty Years' War and also dealing with a revolution in Catalonia which severely hampered Spain's ability to quash the rebellion. Within a matter of hours and with popular support, John, then the 8th Duke of Braganza, was acclaimed as King John IV of Portugal claiming legitimate succession through his grandmother Catherine, Duchess of Braganza. The ensuing conflict with Spain brought Portugal into the Thirty Years' War as, at least, a peripheral player. From 1641 to 1668, the period during which the two nations were at war, Spain sought to isolate Portugal militarily and diplomatically, and Portugal tried to find the resources to maintain its independence through political alliances and maintenance of its colonial income.
His accession led to a protracted war with neighbouring Spain, a conflict known as the Portuguese Restoration War, which ended with the recognition of Portuguese independence in a subsequent reign. Portugal signed lengthy alliances with France and Sweden but by necessity its only contributions in the Thirty Years' War were in the field against Spain and against Dutch encroachments on the Portuguese colonies. The period from 1640 to 1668 was marked by periodic skirmishes between Portugal and Spain, as well as short episodes of more serious warfare, much of it occasioned by Spanish and Portuguese entanglements with non-Iberian powers. Spain was involved in the Thirty Years' War until 1648 and the Franco–Spanish War until 1659, while Portugal was involved in the Dutch–Portuguese War until 1663. In Spain, a Portuguese invasion force defeated the Spanish at Montijo, near Badajoz, in 1644.
King John IV died in 1656 and was succeeded by his son Afonso VI. His daughter, Catherine of Braganza, married King Charles II of England. John was a patron of music and the arts, and wrote with considerable sophistication on music; in addition to this, he was a composer. During his reign he collected one of the largest libraries in the world, but it was destroyed in the Lisbon earthquake of 1755. Among his writings is a defense of Palestrina, and a Defense of Modern Music. One famous composition attributed to him is a setting of the Crux fidelis, a work that remains highly popular during Holy Week amongst church choirs. However, no known manuscript of the work exists, and it was first published only in 1869, in France. On stylistic grounds, it is generally recognized that the work was written in the 19th century. In 1646, John IV proclaimed Mary, in her conception as the Immaculate Conception, the Patroness of Portugal by royal decree of the House of Braganza. The doctrine had appeared in the Middle Ages and had been fiercely debated in the 15th and 16th centuries, but a bull issued in 1616 by Pope Paul V finally " anyone to teach or preach a contrary opinion." Three years later, in 1649, the iconography of the Immaculata was established by Francisco Pacheco, a Spanish artistic advisor to the Inquisition, based on Revelation XII:1.
Titles and styles
19 March 1604 – 29 November 1630: His LordshipDom John of Braganza
29 November 1630 – 1 December 1640: His Excellency The Most Serene Duke of Braganza
1 December 1640 – 6 November 1656: His Majesty The King
John married Luisa de Guzmán, daughter of Juan Manuel Pérez de Guzmán, 8th Duke of Medina-Sidonia. From that marriage several children were born. Because some of John's children were born and died before their father became king they are not considered infantes or infantas of Portugal.