Tens of thousands of Iranians have attended a mass funeral for some 270 soldiers killed in the 1980s war against Iraq.

Authorities recovered the bodies in a mass grave in Iraq in May. On Tuesday, throngs of people gathered in downtown Tehran for the funeral.

The war between Iraq and Iran from 1980 to 1988 killed more than 1 million people. It began when Iraqi dictator Saddam Hussein sent soldiers into Iran following a long history of border disputes.

Since Saddam's overthrow after the U.S.-led invasion of Iraq in 2003, Iran and Iraq have become close allies. Iran's military has helped advise Iraqi security forces and Shiite militias now fighting against the extremist Islamic State group.