The commander of the Iraqi army's 6th division has been killed by shelling west of Baghdad, Prime Minister Nuri al-Maliki's security spokesman said in a statement.