Police officials say the gunmen showed up in four-wheel drive vehicles before storming the buildings in the Zayounah neighborhood in eastern Baghdad. They say at least 18 people were wounded yesterday.
Police have cordoned off the area.
An Interior Ministry official and hospital officials confirmed the casualty figures.
The motive behind the killings was not immediately clear.
The officials spoke on condition of anonymity because they were not authorised to brief the media.