The building was evacuated as a precaution after the sinkhole opened up on Via Marco Aurelio, near the Colosseum.
Around 60 people were reportedly unable to return to their homes after 24 apartments and two businesses were evacuated.
The street was temporarily closed as firefighters, police and housing authorities carried out structural checks.
“Technicians are at work to understand the causes of the incident,” Rome mayor Virginia Raggi told TG24 News.
“Civil protection will relocate all the people who need housing assistance tonight.
“Nobody will be left in the car or on the street.”
Sinkholes are common in central Rome and are sometimes large enough to swallow cars.
Some of the worst-affected areas are the oldest parts of the city, including the area around the Colosseum.
In 2018, the city announced a multi-million-euro plan to fix its streets, but not much progress has been made.