The Napoleonic wars also played a key role in the independence of the Latin American colonies from Spain and Portugal. The conflict weakened the authority and military power of Spain, especially after the Battle of Trafalgar. There were many uprisings in Spanish America, leading to the wars of independence. In Portuguese America, Brazil experienced greater autonomy as it now served as seat of the Portuguese Empire and ascended politically to the status of Kingdom. These events also contributed to the Portuguese Liberal Revolution in 1820 and the Independence of Brazil in 1822.