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, 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). (At this battle Pablo Morillo, future commander of the army that invaded New Granada and Venezuela; Emeterio Ureña, an anti-independence officer in Venezuela; and José de San Martín, the future Liberator of Argentina and Chile, fought side by side against the French General Pierre Dupont.) 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 full Cortes of Cádiz could convene.