<P> To counter the advances the pro-independence forces had made in South America, Spain prepared a second, large, expeditionary force in 1819 . This force, however, never left Spain . Instead, it became the means by which liberals were finally able to reinstate a constitutional regime . On January 1, 1820, Rafael Riego, commander of the Asturias Battalion, headed a rebellion among the troops, demanding the return of the 1812 Constitution . His troops marched through the cities of Andalusia with the hope of extending the uprising to the civilian population, but locals were mostly indifferent . An uprising, however, did occur in Galicia in northern Spain, and from there it quickly spread throughout the country . On March 7, the royal palace in Madrid was surrounded by soldiers under the command of General Francisco Ballesteros, and three days later, on March 10, the besieged Ferdinand VII, now a virtual prisoner, agreed to restore the Constitution . </P> <P> Riego's Revolt had two significant effects on the war in the Americas . Militarily, the large numbers of reinforcements, which were especially needed to retake New Granada and defend the Viceroyalty of Peru, would never arrive . Furthermore, as the royalists' situation became more desperate in region after region, the army experienced wholesale defections of units to the patriot side . Politically, the reinstitution of a liberal regime changed the terms under which the Spanish government sought to engage the insurgents . The new government naively assumed that the insurgents were fighting for Spanish liberalism and that the Spanish Constitution could still be the basis of reconciliation between the two sides . The government implemented the Constitution and held elections in the overseas provinces, just as in Spain . It also ordered military commanders to begin armistice negotiations with the insurgents with the promise that they could participate in the restored representative government . </P> <Table> <Tr> <Th> Part of a series on the </Th> </Tr> <Tr> <Th> History of New Spain </Th> </Tr> <Tr> <Td> </Td> </Tr> <Tr> <Td> <Ul> <Li> Spanish conquest of the Aztec Empire </Li> <Li> Spanish conquest of Guatemala </Li> <Li> Spanish conquest of Yucatán </Li> <Li> Spanish conquest of Petén </Li> <Li> Spanish conquest of the Maya </Li> <Li> Columbian Exchange </Li> <Li> History of the Philippines (1521--1898) </Li> <Li> Piracy in the Caribbean </Li> <Li> Spanish missions in the Americas </Li> <Li> Queen Anne's War </Li> <Li> Bourbon Reforms </Li> <Li> Spanish--Moro conflict </Li> <Li> Spanish American wars of independence </Li> <Li> Casta </Li> </Ul> </Td> </Tr> <Tr> <Td> New Spain portal </Td> </Tr> <Tr> <Td> <Ul> <Li> </Li> <Li> </Li> <Li> </Li> </Ul> </Td> </Tr> </Table> <Tr> <Th> Part of a series on the </Th> </Tr>

Why did spain help the american in the revolutionary war answers