The 1805 Battle of Trafalgar had all but shattered the Spanish navy, with the Peninsular War leaving the Spanish society overwhelmed by continuous warfare and badly damaged by looting. While the Spanish Empire collapsed, the maritime trade trickled to the Americas and Philippines, and Spain's military struggled to keep their colonies, with Mexico getting its independence in 1821. The customary overseas revenue to the metropolis was at a historic low, the royal coffers were empty. Financing (solvency) and recruitment to the military became an overriding concern for the Spanish Crown, with the governments under King Ferdinand VII failing to provide new solutions and stability.