BAGHDAD — Wielding the threat of sectarian slaughter, Sunni Islamist militants claimed on Sunday that they had massacred hundreds of captive Shiite members of Iraq’s security forces, posting grisly pictures of a mass execution in Tikrit as evidence and warning of more killing to come.

The possible mass killing came as militants cemented control of the city of Tal Afar, west of Mosul, after two days of fierce clashes with Iraqi troops, residents and senior security officials said. The city came under mortar attack, sending many residents fleeing toward Sinjar to the west and Mosul to the east. Residents said the militants freed dozens of prisoners.

Even as anecdotal reports of extrajudicial killings around the country seemed to bear out the Islamic State in Iraq and Syria’s intent to kill Shiites wherever it could, Iraqi officials and some human rights groups cautioned that the militants’ claim to have killed 1,700 soldiers in Tikrit could not be immediately verified.

But with their claim, the Sunni militants were reveling in an atrocity that if confirmed would be the worst yet in the conflicts that roil the region, outstripping even the poison gas attack near Damascus last year.