There are very few Spanish kings that participated in one war alone. Spain had once been the most powerful European empire. But things had changed, and now for some time, the country was in crisis in great part due to costly wars which had left it in serious debt, particularly the 80 Years' War.
There were also many rebellions within the empire itself such as the Catalan and Basque revolts, the Portuguese independence war and finally the British and Dutch pirate and corsair attacks on the colonies. So many wars and such a decrease from the country's main source of income, the American colonies, left Spain's treasury completely empty.
Whilst the Spanish were immersed in crisis, the government announced that it would suspend debt payments to their foreign creditors several times in 40 years and had to go through external debt, currency devaluation, and tax increase. It's safe to say that the Spanish were not exactly delighted with the situation.
England wasn't having it easy either, they had gone through the English revolution, the Bishop's war and civil wars in the Isles of the United Kingdom, such as Scotland and Ireland and then the English civil war, which resulted in the execution of king Charles I in 1649.
The Commonwealth of England was established with Oliver Cromwell as head of state. His Foreign Policies in regards to trade were protectionist which led him to war with the United Provinces in the Anglo-Dutch war (1652-1654). Cromwell, backed up by the army, got absolute power and was named perpetual Lord Protector, giving way to the period known as the Protectorate.
After the discovery of America, Pope Alexander VI gave the Catholic kings a Inter caetera (similar to a papal bull), which gave them possession and monopoly of the trade in all the newly discovered or yet to be discovered territories in the Indies (Alexander was, by the way, a man who belonged to the highest Spanish classes.) The Spanish dominion over these lands was ratified by the Vatican in the following years and therefore any trade carried out by foreign ships in the area was considered smuggling and severely punished.
In December 1654 a British fleet of 38 ships (18 of them were warships) under the command of Admiral William Penn and with Robert Venables as troops' general, set sail from Portsmouth and with the Caribbean as destination. Their objective was to occupy an Island or several to establish an operations base from which to attack the continental coast and capture the Spanish treasure fleet.
In April, 1655, after recruiting some 5,000 men in Barbados, the British disembarked some 40 km from Santo Domingo in La Española Island (also known as Hispaniola, which hosts Haiti and Dominican Republic), with the intention of taking over the island.
However the Spanish resistance forced them to retreat and on May 4, the fleet weighed anchor and sailed over to Jamaica, where they arrived in May 11. Admiral William Penn offered the few Spaniards to surrender, but the Spanish, commanded by governor Cristobal de Isasi retreated towards the interior, destroying their own installations
After this failed attempt to take over Jamaica, William Penn and Venables, in open dissension return to England separately, where they are tried for abandoning their posts.
The last effort to capture the Spanish treasure fleet took place in Europe. Admiral Robert Blake received orders from Cromwell to blockade the Cadiz port in order to ambush the Indies Fleet. So Robert Blake, with 28 ships, blocked the entrance to the Gibraltar Strait, getting their provisions from Lisbon. But the course of action was to winter in the Caribbean once they were warned of the threat. On October 6, to Cromwell's chagrin, Blake returned to England without establishing contact with their objective.
In May, in an interview with Oliver Cromwell the Spanish ambassador in England presented the Spanish negative to allow British trade in the Indies refusing also to grant the British citizens residing in Spain immunity to the Spanish Inquisition, however Philip IV does propose a military alliance between England and Spain.
But by the end of July the Spanish king heard the news about the attempt to occupy Hispaniola and Jamaica. The Spanish ambassador was instructed to demand the return of Jamaica and reaffirm Spain's right to Spanish monopoly in the Indies. Cromwell refused and this was interpreted by Spain as a war declaration. Honestly, they were right on the mark, that was just what he was trying to achieve.
In fact the British citizens that lived in Spain had been warned beforehand of Cromwell's intention to declare war on Spain, so they wouldn't compromise their capital in Spain. Some of them had sold all their goods at a low price. In September Philip IV ordered the confiscation of all British ships and merchandise in Spanish territory and cut all trade relations with England.
In October, 1655 Oliver Cromwell published a manifesto in which he justified the motives that led him to declare war on Spain. Among his points was the arbitrary Spanish privileges of navigation and trade in the Indies, the Spanish attacks against the British settlements a few years earlier, the British smuggling ships captured by the Spanish and some other outlandish claims.
After the manifest, all negotiations between Spain and England were over and Cromwell thought it was a good idea to form an alliance with France and on November 3 he signed the Treaty of Westminster.
In March 1556 the British fleet, commanded by Robert Blake and Edward Montagu, 1st Earl of Sandwich set sail towards Spain with the mission of capturing the Spanish treasure fleet. Again they settled themselves near the Cadiz Bay waiting to ambush the fleet.
In September Richard Stayner commanded an attack on the Spanish fleet led by Juan de Hoyos, obtaining booty of 2 million pesos and in April of the next year, Robert Blake and Stayner successfully attacked the Spanish treasure fleet moored in the port of Santa Cruz de Tenerife.
In less than 12 hours the defences of the city were overpowered. 6 galleons and 10 other Spanish ships were destroyed. The attack also resulted in 50 dead and 150 wounded. However, the bulk of the treasure the ships transported was salvaged.
Oliver Cromwell died in 1658 and his son Richard succeeded him as Lord Protector. However his relationship with the army was rocky to say the least and the economic situation in Britain was on the precarious side which gave way to great instability in the country. In 1659 Richard Cromwell resigned and in April 1660 the monarchy was restored and Charles II rose to power. Two months later Charles suspended the hostilities against Spain.
The Treaty of Madrid (1667) ended the war officially and three years later Spain and England signed a new treaty in which Spain recognized England's sovereignty over all its provinces, islands, colonies and domain in the Western Indies or any other part of America that the king and his subjects possessed at that moment.
The treaty didn't specify which territories were those exactly, which would give way to subsequent dispute between both countries ...however they both promised not to navigate or trade in the places occupied by the other.