Reporters were able to visit the site after Iraqi security forces took control of the western half of Mosul.
According to local villagers, the thousands of bodies contained in the grave are those of security personnel killed by the Islamic State group after they captured Mosul in 2014.
Some of the victims, witnesses said, were drivers who had driven their vehicles into the pit.
"Daesh would drive the victims to Khasfa in convoys of minibuses, trucks and pick ups. The men had their hands bound and their eyes blindfolded," said Mahmoud, a local resident from the village of Saranik.
"They were taken to the sinkhole and shot in the back of the head."
Among the dead in Khasfa are 2000 policemen and soldiers who were butchered in a single day, says Mahmoud, who claims that he was forced to watch four mass executions by the militants.
"In the beginning, you couldn't see the corpses at the bottom of the hole. Only later, when it began to fill up could you see the bodies," he said.
On another occasion, Mahmoud recalls having watched blindfolded Yazidi men being driven to the edge of the hole and then rolled over the edge.
|Iraqi security forces have uncovered many mass graves in areas formerly held by the IS group [AFP]|
The killings began half a year after the IS group captures Mosul, locals said.
Lists of those who were executed by the extremists would later be posted in local mosques.
In November, a mass grave containing around 300 bodies was discovered by security officers in a town around 30 kilometres from Mosul city.
The sheer scale of the killing perpetrated at Khafsa, however, dwarfs all other known sites in Iraq, even outstripping the IS massacre of around 1700 military recruits at the Camp Speicher military base near Tikrit.
"And from what we have heard it is not just a grave but also an execution site," said Belkis Wille, senior Iraq researcher for Human Rights Watch.HRW monitored the sinkhole via satellite as the massacres continued, with researchers from the watchdig reporting that they could see it filling up.
Locals say that the militants later began filling the pit with shipping containers and concrete blast walls, before covering it with dirt.
This gave the Khasfa sinkhole its current look, which is that of a slight depression in the barren desert along the Baghdad-Mosul highway.