 Pelotas was besieged and conquered by the Ragamuffins on 7 April 1836 . Marques de Sousa was taken prisoner and removed to Porto Alegre , capital of Rio Grande do Sul , which had been under rebel control since the beginning of the conflict . He was held in a presiganga ( prison ship ) . During his imprisonment , with the aid of the people of Porto Alegre , he managed to convince some of the rebel soldiers to switch sides , taking control of the entire town during the early hours of 15 June and arresting the remaining Ragamuffins . He repulsed rebel land and sea assaults against Porto Alegre on 18 June , 30 June , 15 July and 20 July ; thereafter , the town remained in the hands of the legitimate government until the end of the conflict . The central government in Rio de Janeiro promoted Marques de Sousa to permanent major on 18 February 1837 in recognition of his vital role . The balance of power tipped against the Ragamuffins only a few months after the declaration of Rio Grande do Sul 's independence on 11 September 1836 . The Ragamuffins , although emboldened by their initial successes , never managed to gain control of the entire province . 
