When jihadists from the Islamic State group attacked last week, the Shiite village of Al-Saud in central Iraq received help from an unlikely source.
The police chief from the neighbouring Sunni town of Dhuluiyah, once a key Al-Qaeda hub, came with a detachment of men and 15,000 rounds of ammunition.
"It is the first time Sunnis and Shiites fight together like this against IS," said Mullah Maher al-Juburi, the imam of Dhuluiyah, a town nestled in a U-bend on the Tigris river.
"They help us, we help them," he said from his villa, which the tribal fighters routinely use as a command centre.
Dhuluiyah's size belies its role in Iraq's tumultuous recent history.
It was the target of the first major US counter-insurgency raid after the invasion, in June 2003. It then became a centre for the Islamic State's previous incarnation, Al-Qaeda in Iraq.
Mullah Maher's brother was one of its leaders but switched sides and became a central figure of the Awakening movement masterminded and funded by the US military to turn Sunni tribes against the insurgency.
And now Dhuluiyah takes pride in being the first place where the jihadists met Sunni resistance in June as they swept towards Baghdad.
"They came from Mosul and just marched through one Sunni village after another without a fight but their advance stopped here," said Mohannad, a 27-year-old who left his job at Tikrit hospital to fight four months ago.
- Breaking the stalemate -
The jihadist advance, in fact, stopped half way into Dhuluiyah, whose northern tribes let them in while the southern Jubur neighbourhood fought back.
"We know the people we are fighting, we recognise their faces," said Ibrahim al-Juburi, a 56-year-old former general in the army of executed president Saddam Hussein.
"We helped put them in jail in Abu Ghraib, Tikrit, Badush (near Mosul) and Taji" during the Awakening, he said.
Some escaped in prison breaks and advancing IS fighters freed the rest in June.
The motivation for holding out is clear: while IS gave most people in the Sunni areas they took a chance to pledge allegiance, they would have slaughtered the "traitors" of the Jubur tribe.
Maher al-Juburi inherited Dhuluiyah's largest mosque when his brother "Mullah Nadhom" was shot dead near Baghdad's Green Zone in 2012.
Signup to our newsletter and follow us on Facebook and Twitter!
"We will never let them in again... We know it is a foreign project," the young imam said.
On the frontline at the other end of Jubur, the body of an IS fighter has been lying under a tree for three days.
"We're not sure where this one is from," said police officer Abdallah Ali Hammash, "but so many of them are foreigners. There were two Yemenis killed in the same attack."
His post is a pink building that was once the cafeteria of an amusement park, which now marks one of Dhuluiyah's frontlines.
The cars of the ferris wheel are riddled with bullets and in its shadow lie the rotting bodies of more jihadists, left because of sniper fire.
Iraqi troops swooped down from the north last week to break the four-month deadlock.
- 'In this together' -
On some days there are only around 150 IS fighters left in one main neighbourhood of the town and Jubur residents feel victory is close.
"We've done 80 percent of the work, but we still need more help," said Mohannad.
The main street is teeming with army and police armoured vehicles and has become a giant open-air workshop where soldiers tinker away to fix a wheel mangled by a roadside bomb or repair a machinegun.
"We're all in this together now," said Ghassan, a tall Shiite policeman. "I consider myself to be from Dhuluiyah now."
Several residents from Al-Saud and other Shiite villages are now in Jubur, fighting with the Sunni tribesmen.
And some Sunni tribes north of Dhuluiyah assisted the army as it launched an offensive last week.
The latest developments in Dhuluiyah -- once watched as a harbinger of which way Iraq's Sunni minority would lean -- could lead optimists to see the emergence of an anti-jihadist alliance.
But years of fighting, deals and betrayals have left the town and its people exhausted and fragmented, focused only the immediate survival of their closest tribal circle.
"The tribes in the north, they thought the Sunni revolution was coming. Now they can see what these people do to women and children," said Mullah Maher.
"Some of them are changing their minds, they want to switch sides but it's not really happening on a big scale. It's a bit late."