The Brazilian Armed Forces were created in the aftermath of Independence. They were originally composed of Brazilian- and Portuguese-born officers and troops who had remained loyal to the government in Rio de Janeiro during the war of secession from Portugal. The Armed Forces were crucial to the successful outcomes of international conflicts faced by the Empire, starting with Independence (1822–1824), followed by the Cisplatine War (1825–1828), then the Platine War (1851–1852), the Uruguayan War (1864–1865) and, finally, the Paraguayan War (1864–1870). They also played a part in quelling rebellions, beginning with the Confederation of the Equator (1824) under Pedro I, followed by the uprisings during Pedro II's early reign, such as the Ragamuffin War (1835–1845), Cabanagem (1835–1840), Balaiada (1838–1841), among others.