History: The story of Spain in the 18th Century was far from pleasant. With Joseph Ferdinand of Baviera's sudden death at age 7 in Brussels, the ill King Charles II signed a will favouring Philip d'Anjou, which led to the War of Spanish Succession in 1700. The Grand Alliance of England, the United Provinces of the Netherlands and the Austrian Empire, along with Portugal and Savoy once they defected from the French side, declared war against the Two Crowns of France and Spain in order to preserve the European balance of power. In 1704 and 1705, the Alliance managed to take Madrid, seat of the Bourbon Philip V. They were however defeated and practically expelled from the Peninsula after the Battle of Almansa in 1707, although Archduke Charles remained in Barcelona as Charles III. Fortunately for the Austrian aspirations, the French defeats at Ramillies and Oudenaarde forced Louis XIV to negotiate his surrender.
After arduous but somewhat brief negotiations, France retired from the war and recognized Charles III as King of Spain. Naples was ceded to France in return, and the Grand Alliance easily wept out the scattered and demoralized Spanish forces loyal to Philip, which had been fatally weakened by the withdrawal of all French forces. After he fled to France with the Allies in pursuit, Philip was named Prince of Naples, coming to act as Regent during the infancy of his niece Louis XV after the death of his grandfather, Louis XIV.
The new Spanish monarch arguably conducted his affairs much more diligently than the last few Hapsburgs, so notably hindered by certain biological issues. He quickly created the Viceroyalty of La Plata to govern the southern half of the immensely huge Viceroyalty of Peru. A new, faster route was designed to carry the goods produced south from Potosí, transporting them down the river to the now-fortified port of Buenos Aires. From there, they would be directly transported to Spain. This marginally faster route had the advantage of being wholly ocean-going, thus being far less exposed to pirates and buccaneers than the Caribbean route.
Back in the Peninsula, however, things weren't going as smoothly. Many noblemen were still opposed to Charles III, and when his brother died unexpectedly and Charles rushed to Vienna to be crowned Emperor, a full-scale uprising was staged. The new Emperor had on his side the fact that much of the Spanish court had been filled with Catalan, Aragonese and Valencian noblemen, who had supported him in the war in front of the Castillian side which saw him as an imposed foreigner. This shunned the most reactionary noblemen from positions of relevance, with the revolted forces being scarce and sparse when the time came.
Unfortunately for Charles III, though, both France and England now saw it fit to support the revolted lords to avoid the concentration of forces in Hapsburg hands, reigniting a conflict that had just ended. Far away from Spain and with matters spiralling out of his control, Charles III resolved to preserve what still was the largest empire in the world. Quickly mustering as many men as he could, he sent a force to reinforce his loyal troops and put down the rebels. In Navarra, however, French troops reinforced the rebels. With the situation stalled in the Peninsula, Italy and the Austrian Netherlands were quickly ran over, forcing the Emperor to the table. In the peace treaty, the Austrian Netherlands were ceded to France (which would subsequently lose them to the United Provinces later in the century), and Charles III agreed to split his German and Spanish possessions in his will. Both Hapsburg and Bourbons renounced their Spanish claims, with the house of Savoy set to inherit the throne after the death of the last Spanish Hapsburg.
Thus, Charles Emmanuel III of Sardinia came to become, in 1740, Charles Emmanuel I of Spain. Soon enough, he decided to join Maria Theresa's side in the War of Austrian Succession, hoping to reclaim Naples from the Bourbons in order to establish a true Italian kingdom which would be part of a great Latin Empire. Charles Emmanuel had already lost some of his lands in Savoy when again he sided with the Hapsburg in the War of Polish Succession, but this time he was expelled from Italy altogether: The will of Charles III already left the remaining Italian possessions of Spain to the Austrian heir.
Barely a decade later, Britain declared war on Spain for its colonies, and after much worthless fighting, the Seven-Year War ended with the loss of Florida and the cession of Louisiana by the French. Things would not fare well for the House of Savoy afterwards. In 1789, merely months before France woke in the most violent revolution that would be seen, Spain itself saw its own malnourished peasantry rise in arms in some regions in protest for the rise of bread prices. This aborted revolution would be but a warning of the events that were to shock Europe in the following decades.
By then, Victor Amadeus of Spain had replaced his father, saving Spain from the total decadence that it hinted at since the last Hapsburgs. This came at a cost, however, as he saw himself forced to bow to Aragonese, Valencian and Catalan institutions, old remnants of medieval times that no ruler had yet squashed. He managed to get from them what the Count-Duke of Olivares hadn't more than a century ago: a military union of all kingdoms for the defence of the Empire, merely at the cost of commercial privileges with the colonies and marginally greater autonomy. Military efficiency, however, would prove too costly for Spain once coupled with the autonomy of lands on which the Napoleonic Wars would be fought.
When the new Republic of France grew, Spain seemed ready to strike at them, but the seemingly precarious forces of the infant state would prove a hard opponent for the apparently superior Spanish forces. A few key but costly victories of Victor Amadeus I led to a favourable settlement in which Spain would see the Roussillon returned and the King of Spain would regain the empty title of Duke of Burgundy. Satisfied with the settlement but weary of the growing Republic, the king stationed his army in Catalan lands until they were defeated by the bold Emperor and the same land was subsequently occupied by the French. This drained many resources from the land and generated bitter resentment towards the king, seeing in it a repetition of the Thirty Years War that led precisely to the loss of Roussillon to the French.
Thus, when the French crushed the Spanish army in Roussillon and Catalonia and occupied the Peninsula, the damage done to the crown was irreparable. In the upcoming years, in order to ensure the better military defence of the colonies, the Viceroyalty of La Plata had been upgraded to Principality, and Prince Charles, Duke of Burgundy was sent there. It was considered by Victor Amadeus that the management of the South American colonies would make for the best of education in governance. This measure tightened the royalist grip on the lands around the rivers, but no effects of this strengthened military and royal presence were much felt on the other side of the Andes.
Not ten years had passed that, in 1796, Prince Charles was recalled to assume the throne on the death of his father. Thus, given his lack of offspring, his brother Victor Emmanuel became Prince of La Plata. Soon thereafter, however, the brief Charles IV would be expelled from the Peninsula by the unstoppable French forces. Attempting to escape to the colonies, the unprepared Spanish Navy suffered a great defeat at the hands of the French, with the King himself being lost. Napoleon was quick to install his brother Joseph in the throne, preventing the far away Victor Emmanuel to reclaim his position.
After the first defeat of Napoleon, an attempted comeback was thwarted by the Spanish liberals, imbued with the republican spirit of France and spurred by the still outraged Catalans to not allow any kind of royal authority to regain a seat of power. In the aftermath of the wars, Spain was no more, and the Empire disintegrated. Prince Victor Emmanuel attempted all to oppose the secessions, but his lack of naval projection due to the loss of most of the navy to rebels or the French impeded him from acting beyond the Andes. His troops were held by a ragtag army at mountain ports all along the western edge of the riverlands, and even won some land. Eventually, a cease-fire was arranged.
Although no peace treaty was ever signed, most colonies became de facto independent from Buenos Aires, as efforts were led into establishing a decent naval power able to protect its trade, main source of income of the Principality. As of 1831, Prince Charles Philip rules La Plata, without relinquishing his claims on Spain or acknowledging the de iure independence of the former colonies, wrestling for control and influence over Paraguay with Brazil and his eyes set on again establishing a firm grip on Uruguay and the Pampa.