The Riograndense Republic is proclaimed by rebels after defeating Empire of Brazil's troops in the Battle of Seival, during the Ragamuffin War.

The Ragamuffin War (Portuguese: Guerra dos Farrapos or Revoluo Farroupilha) was a Republican uprising that began in southern Brazil, in the province (current state) of Rio Grande do Sul in 1835. The rebels were led by generals Bento Gonalves da Silva and Antnio de Sousa Neto with the support of the Italian fighter Giuseppe Garibaldi. The war ended with an agreement between the two sides known as Green Poncho Treaty (Portuguese: Tratado de Poncho Verde) in 1845.

Over time, the revolution acquired a separatist character and influenced separatist movements throughout the entire country such as the Liberal Rebellions in So Paulo, Rio de Janeiro, and Minas Gerais in 1842, and the Sabinada in Bahia in 1837.

It was inspired by the recently ended Cisplatine War, maintaining connections with both Uruguayan leaders as well as independent Argentine provinces such as Corrientes and Santa Fe. It even expanded to the Brazilian coast, in Laguna, with the proclamation of the Juliana Republic and to the Santa Catarina plateau of Lages.

The abolition of slavery was one of the demands of the Farrapos movement. Many slaves organized troops during the Ragamuffin War, the most famous of which is the Black Lancers Troop, annihilated in a surprise attack in 1844 known as Battle of Porongos.

The Riograndense Republic, often called the Piratini Republic (Portuguese: República Rio-Grandense or República do Piratini), was a de facto state that seceded from the Empire of Brazil and roughly coincided with the present state of Rio Grande do Sul. It was proclaimed on 11 September 1836, by General Antônio de Sousa Neto, as a direct consequence of the victory obtained by Gaúcho oligarchic forces at the Battle of Seival (1836) during the Farroupilha Revolution (1835–1845). It had a constitution adopted in 1843 and was recognised only by the United Kingdom, France, and Uruguay.

In 1839, the Riograndense Republic formed a confederation with the short-lived Juliana Republic (Portuguese: República Juliana) which proclaimed its independence in the same year. November 1839, however, saw the war result in the defeat and disappearance of the Juliana Republic. The Riograndense Republic had five capitals during its nearly nine years of existence: the cities of Piratini (for which it is often called Piratini Republic), Alegrete, Caçapava do Sul (official capitals), Bagé (for only two weeks), and São Borja. The war between the Gaúchos and the Brazilian Empire was ended by the Ponche Verde Treaty.