European events sowed the seeds of Venezuela's declaration of independence. The Napoleonic Wars in Europe not only weakened Spain's imperial power but also put Britain (unofficially) on the side of the independence movement. In May 1808, Napoleon demanded and received the abdication of Ferdinand VII of Spain and the confirmation of the abdication of Ferdinand's father Charles IV. Napoleon then appointed as King of Spain his own brother Joseph Bonaparte. That marked the beginning of Spain's own War of Independence from French hegemony and partial occupation before the Spanish American wars of independence even began. The focal point of Spanish political resistance, the Supreme Central Junta, was formed to govern in the name of Ferdinand. The first major defeat that Napoleonic France suffered occurred at the Battle of Bailén in Andalusia (July 1808). Despite this Spanish victory, the French soon regained the initiative and advanced into southern Spain. The Spanish government had to retreat to the island redoubt of Cádiz. Here, the Supreme Central Junta dissolved itself and set up a five-person regency to handle the affairs of state until the deputies of the Cortes of Cádiz could convene.