The epicentre of the natural disaster on Sunday was 32 km southwest of the Halabja area near the Iranian border at the depth of 33.9 km, according to the US Geological Survey (USGS), Xinhua news agency reported.
Iranian state media reported seven people had died in the quake.
Scores of people were injured in the border city of Qasr-e Shirin in Iran, state TV reported.
Many residents in Baghdad rushed out of houses and tall buildings in panic.
'I thought at first that it was a huge bomb.
The quake was centred about 30km southwest of Halabjah and 100km from the city of As-Sulaymaniyah, in the semi-autonomous Kurdistan region.
It was felt for about 20 seconds in Baghdad, and sometimes for longer in other provinces of Iraq.
"The quake was felt in several Iranian provinces bordering Iraq ..." But then I heard everyone around me screaming "Earthquake!"'. The Washington Post adds that 2 more people have been reported dead thus far in Iran, and the number of dead is expected to rise as recovery operations continue.
A magnitude 7.2 quake shook Iraq on Sunday, authorities said, without causing any casualties or major damage in the country or in neighbouring Iran and Turkey where it was also felt.