Ramadi was recaptured at the end of last month from IS, which overran large parts of Iraq in 2014 and has repeatedly carried out mass killings and other atrocities in areas it controls.
“So far, we have removed 18 bodies including five members of the police, and work is continuing to remove the remaining victims,” police Major Tareq Abdulkarim told AFP.
The mass grave in the Al-Jamiya area of central Ramadi, which was found on Monday, is “expected to contain the bodies of 40 victims,” Abdulkarim said.
He added that the victims were from Ramadi and were executed by IS in May 2015, when the jihadists succeeded in overrunning the city.
Doctor Shakir Ahmed al-Hajj said that medical staff were working to disinter the victims and that “dozens” of bodies had been removed from the grave so far, while the work was still ongoing.
And Sabah Karhout, the head of the Anbar provincial council, confirmed that the grave was discovered and said the victims had either been shot or beheaded.
Militants had held shifting parts of Anbar capital Ramadi since early 2014, but IS only succeeded in overrunning the entirety of the city last May.
Iraqi forces recaptured Ramadi after months of fighting during which surrounding areas were retaken from the jihadists, setting up the final push into the city centre.
IS has suffered major losses since the height of its territorial control in 2014, but still controls significant areas of Anbar and Nineveh province to its north, as well as in neighbouring Syria.