AMERLI Iraq - Kurdish peshmerga fighters and Shi'ite militiamen paraded through Amerli on Monday, a day after breaking the two-month siege of the northern town by Sunni Islamist militants.
The scenes in Amerli and the surrounding area of Suleiman Beg offered a window into the teamwork among Kurdish fighters, the Iraqi army and Shi'ite militias and into Iran's role in directly assisting their campaign against Islamic State (IS) forces.
An Iranian adviser to Iraqi police was spotted on the road near Amerli and Kurdish officers spoke of Iranians advising Iraqi fighters on targeting the Islamists.
The swift end to the Islamic State's encirclement of the Shi'ite Turkmen town of 15,000 came on Sunday amid a push by Kurdish peshmerga, Shi'ite militias and Iraqi troops, after US air strikes late Saturday hit IS positions.
Shi'ite militias, who battled US troops during their occupation of Iraq, played a song in Amerli on Monday that taunted the extremist Islamic State with the line: "The Americans couldn't beat us and you think you can?"
The town was filled with Kurdish peshmerga and fighters from the largest Shi'ite militias - the Badr Organisation, Asaib Ahl al-Haq, Kata'ib Hezbollah and cleric Muqtada Sadr's followers.
Militia fighters spoke of a new alliance with the Kurds, who had been shaken by the Islamic State's offensive on Kurdish-controlled territories last month. They were then helped by US air strikes that forced IS to retreat.
"I'm totally confident that the failure of the peshmerga to stop the Islamic State's advance towards areas around Arbil forced the Kurds to review their wrong policy of refusing to cooperate with us," said a fighter from Asaib Ahl al-Haq.
"Without our help, it will be difficult for them to stop Islamic State fighters alone."
Militia and Kurdish fighters on Monday entered the nearby community of Suleiman Beg, an Islamic State stronghold since earlier this year.
Peshmerga planted their flag on top of a building and Asaib Ahl Haq fighters chanted "Ya Hussein", the name of a revered Shi'ite religious figure. The militia men skirted around the buildings and lobbed dynamite into houses to clear them of any explosives left by the Islamic State.
"The peshmerga just came now and raised their flag. We have been here (in the area) for eight days," said one Asaib Ahl al-Haq fighter.
The influence of Iran was evident in Suleiman Beg. With Asaib Ahl al-Haq, which is funded by Iran and recognises Iran's Supreme Leader Ali Khamenei as its spiritual guide, were two men who spoke Farsi and dressed in beige uniforms different from their colleagues' green camouflage.
Asked if he was Iranian, one of the Farsi speakers said: "We are liberating Suleiman Beg."
Asked if the Iraqis' could have made their recent gains without Iranian support, he answered: "No."
By a convoy of armoured police vehicles, a man speaking Farsi described himself as coming from Iran and said he was there to help with training police.
A peshmerga commander in Suleiman Beg acknowledged the part played by Iranians in the assault on Islamic State positions. "The Iranians had a role in this. They supplied weapons and helped with the military planning," he said on condition of anonymity.
"They trained the Shi'ite forces. There are Iranians here in another base: three or four of them. They are guiding the peshmerga in firing heavy artillery. They don't speak Kurdish - they have a translator."
On Saturday, a senior member of the Kurdish party, the Patriotic Union of Kurdistan, told Reuters the Iraqi military, Kurds and Iranian advisers had joint operation centres.
Speaking in Khanaqin in Diyala province, PUK member Mala Bakhtiar said the Iranians did not participate in actual fighting but provided expertise.
"There is logistical help and cooperation," Bakhtiar said. "If there is a need, we meet with them and discuss the issues."
The defeat of the IS in Amerli and Suleiman Beg was a major victory for the Iraqi government, security forces and militias after weeks of setbacks.
Shi'ite militia fighters were firing automatic weapons in the air in celebration on a road to Amerli.
Outgoing Prime Minister Nuri al-Maliki, due to step down this month when a new government is formed, flew to Amerli and saluted the military and the militia fighters, whom he called Mujahideen (holy warriors).
"Our enemy is retreating and our security forces backed by volunteers are advancing to purge further towns," Maliki told a cheering crowd.
Ordinary people in Amerli rejoiced at their escape from IS. "We were steadfast until the end," said 66-year-old resident Amin Samin Mohammed. "We never intended to leave."