Spain and Portugal enters the warHavana, Cuba
For most of the Seven Years' War, Spain remained neutral, turning down offers from the French to join the war on their side. During the war's latter stages, however, with mounting French losses to the British leaving the Spanish Empire vulnerable, King Charles III signaled his intention to enter the war on the side of France. This alliance became the third Family Compact between the two Bourbon kingdoms. After Charles had signed the agreement with France and seized British shipping alongside expelling British merchants, Britain declared war on Spain.
In August 1762, a British expedition captured Havana, then a month later capturing Manila as well. The loss of the colonial capitals in the Spanish West Indies and East Indies was a huge blow to Spanish prestige and its ability to defend its empire. Between May and November, three major Franco-Spanish invasions of Portugal, Britain's long time Iberian ally, were defeated. They were forced to withdraw with significant losses inflicted by the Portuguese (with significant British assistance). By the Treaty of Paris, Spain handed over Florida and Menorca to Britain and returned territories in Portugal and Brazil to Portugal in exchange for the British handing back Havana and Manila. As compensation for their ally's losses, the French ceded Louisiana to Spain by the Treaty of Fontainebleau.