A strong earthquake rattled the Iraqi capital Baghdad and also hit the border area with Iran, local media sources reported on Sunday.