 The governments of these regions, which had their origins in the juntas of 1810—and even moderates there who had entertained a reconciliation with the crown—now saw the need to separate from Spain, if they were to protect the reforms they had enacted.Spanish liberals finally had success in forcing Ferdinand VII to restore the Constitution on January 1, 1820, when Rafael Riego headed a rebellion among troops which had been gathered for a large expeditionary force to be sent to the Americas.By 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.