An AFP team visited the isolated site that was recaptured recently by elite interior ministry forces down a dirt track outside the village of Tall Adh-Dhahab, some 10 kilometres (6 miles) south of Mosul.
Bone fragments were scattered around the location along with scraps of clothing -- including a man's headdress, ripped trousers and a flip-flop.
The stench was overpowering and several bullet casings could be seen.
Earth was piled in metre-high mounds at the entrance to the shallow pit, located behind a small sand-covered hill.
More From This Section
"The majority of them were members of the security forces, army and police," Lieutenant Yahya Jumma told AFP at the scene.
"They brought them by pickup trucks -- they were around 40 people according to eyewitnesses who saw them," he said.
Iraqi security forces have discovered several IS mass graves in areas that they have taken back from the group.
Authorities are investigating a mass grave found last week in the town of Hamam al-Alil to the southwest of the newly discovered site.