It was unclear why the four-story buildings, located in the western neighborhood of Itanhangá, collapsed. Locals said at least four families were living in the buildings, which were undergoing construction. An unknown number of people were still missing, locals and officials said.
"Two people were injured and two were killed, and teams are on the scene looking for survivors who may be buried," a fire department spokesman said.
The mayor's office said the two buildings were irregular constructions, which had not been authorized. Brazilian cities underwent rapid and mostly unplanned urbanization in the last six decades, giving rise to vast shantytowns, erected haphazardly without adhering to building codes.
Powerful militias - originally created to defend inhabitants from drug gangs, but which now act as fearsome local crime outfits - have a strong presence in the neighborhood where the buildings collapsed. Militias often control gas and electricity services, but now make huge profits by stealing land and illegally selling it for construction projects.
"As (the region) is dominated by militias, the technicians of the municipal inspection office usually require the support of the military police to carry out inspections there," the mayor's office said in a statement, adding that it had shuttered several unauthorized constructions nearby last November.
A man who said he was a resident in one of the buildings told reporters that he made it out after hearing a snap.
"I managed to escape, but there were people left behind," said the man, who declined to give his name.