The foreign relations of Spain could be constructed upon the foreign relations of the Hispanic Crown. The personal union of Castile and Aragon that ensued with the joint rule of the Catholic Monarchs was followed by the annexation of the Kingdom of Granada and the Kingdom of Navarre. The crown also built a large colonial empire in the Americas after the arrival of Columbus to the New World in 1492. The Spanish Habsburg monarchs had large holdings across the European continent stemming from the inherited dominions of the Habsburg monarchy and from the Aragonese holdings in the Italian Peninsula. The Habsburg dynasty fought against the Protestant Reformation in the continent and achieved a dynastic unification of the realms of the Iberian Peninsula with their enthronement as Portuguese monarchs after 1580. The American colonies shipped bullion, but resources were spent in wars waged against France in Italy and elsewhere as well as in conflicts against the Ottoman Empire, England or revolts in the Spanish Netherlands, Portugal (lost after 1640) and Catalonia. Mainland Spain was the main theatre of the War of Spanish Succession (1701–1714), after which the Bourbon dynasty consolidated rule, while handing in holdings in Italy and the Netherlands. The successive Bourbon Family Compacts underpinned a close alignment with the Kingdom of France throughout the 18th century. During the Napoleonic Wars, Mainland Spain was occupied by the French Empire (which installed a puppet ruler), and became after an 1808 uprising the main theatre of the Peninsular War. Nearly all its colonies fought for and won independence in the early 19th century. From then on it kept Cuba, Puerto Rico and the Philippines, otherwise lost in 1898 after the Spanish–American War, and, in line with far-reaching efforts by other European powers, Spain began to sustain a colonial presence in the African continent, most notably in Western Sahara and Equatorial Guinea. It also intervened in Nguyễn Vietnam alongside France and involved in the affairs of former colony Santo Domingo, which briefly returned to Spanish control. In the wake of the creation of a Spanish protectorate in Northern Morocco, the early 20th century saw a draining conflict against Riffian anti-colonial resistance. Spain stuck to a status of neutrality during World War I. The Spanish Civil War of 1936–1939 became a proxy war between the axis powers Germany and Italy and the Soviet Union (which lost). The war ensued with the installment of a