Carvalho returned to Brazil and partook in an attempt to depose dictator Getuilo Vargas, and was subsequently stripped of his position as lieutenant in the Brazilian Army. After the 1964 military coup he criticised the Brazilian Communist Party for refusing to engage in guerilla warfare, as well as for their authoritarian and instrumental methods. In 1967 he was finally expelled and founded the Brazilian Revolutionary Communist Party a year later to continue armed struggle against the dictatorship. He was arrested and tortured, but released and sent into exile in Algeria in 1970 in exchange for , the German ambassador who had been taken hostage by leftist guerillas. In 1979 Carvalho returned to Brazil as the military dictatorship had become weaker, and took part in forming the Workers' Party (PT) the following year. He was also for a time its vice president.