Hashemi served as one of the Tehran's Friday Prayer Imams (for next thirty years), Representative of Khomeini at Defence High Council (after death of Mostafa Chamran) and Second-in-Command of Iran's Joint Chiefs of Staff in the last year of Iran–Iraq War. He forced Khomeini to accept to end the war. Only three months after his appointment as Iran's deputy commander-in-chief, Iran accepted United Nations Security Council Resolution 598 and eight-year war was ended.