(Corrects name of analyst's think-tank in paragraph 19)
* Iran-backed militias pushing to cut Saudi ties
* Abadi priority to keep anti-IS allies onboard
* PM caught between Sunni and Shi'ite hardliners
By Maher Chmaytelli
BAGHDAD, Jan 6 (Reuters) - Iraq dispatched its foreign minister to Tehran on Wednesday with an offer to mediate in an escalating feud between Saudi Arabia and Iran, reflecting Baghdad's fears that new sectarian conflict could unravel its campaign against Islamic State.
Sunni Saudi Arabia's execution of Shi'ite dissident Nimr al-Nimr on Saturday has inflamed sectarian anger across the Middle East, infuriating Iran, the region's main Shi'ite Muslim power. After demonstrators sacked the Saudi embassy in Iran, Riyadh and some of its allies cut off diplomatic ties with Tehran.
Iraq, where a Shi'ite-led government is urgently trying to reach out to minority Sunnis as it seeks to retake territory controlled by Islamic State militants, is particularly vulnerable to any upsurge in anger between the Muslim sects.
Powerful Iran-backed Shi'ite militia called on Iraqi Prime Minister Haidar al-Abadi -- a Shi'ite who has staked his credibility on efforts to reconcile with Sunnis -- to shut a Saudi embassy that reopened only last month after decades of strained ties. Thousands of Shi'ites rallied in central Baghdad on Wednesday chanting slogans against the Saudi ruling family.
Abadi sent Foreign Minister Ibrahim al-Jaafari to Tehran to help defuse the crisis. Speaking with his Iranian counterpart Mohammad Javad Zarif, Jaafari said the row could have "wide-ranging repercussions".
"We have solid relations with the Islamic Republic (Iran) ... and also we have relations with our Arab brothers and therefore we cannot stay silent in this crisis," Jaafari told the joint press conference in Tehran.
There was no immediate reaction from Saudi Arabia to the Iraqi mediation offer.
In what militia leaders described as only an early taste of the potential for street anger, a few thousand Shi'ite demonstrators rallied in central Baghdad on Wednesday and in smaller numbers in southern Shi'ite cities.
"No, no to Al Saud! No, no to the embassy!" chanted the demonstrators who gathered on Tahrir (Liberation) Square in Baghdad, carrying the flags of the three most powerful Iranian-backed militias -- Badr Organisation, Asaib Ahl al-Haq and Kataib Hezbollah.
"If our demands are not met we will take escalating measures," said Hajj Jawad al-Tulaibawi, a military spokesman for Asaib who was present at the protest.
"We say to Abadi... he who leads needs to have a strong heart and be brave," he told Reuters. "If he can't, he should leave."
Abbas al-Tamimi, an Asaib leader at a small protest in the southern city of Basra, said a bigger response to Nimr's death was coming.
"The people's patience with the crimes of the Al Saud tyrants has run out," he told Reuters at the Basra protest.
Abadi took power in 2014 after Iraq's army crumbled in the face of an onslaught by Islamic State militants, who swept through most of Iraq's Sunni areas, capitalising on resentment to the Shi'ite-led authorities in Baghdad.
The prime minister initially relied on Tehran-backed Shi'ite militias to help defend the capital. But more recently he has challenged militia leaders with deep political reforms designed to curb the influence of sectarian political parties.
BETWEEN IRAN AND ARAB COUNTRIES
The Saudi embassy, which reopened last month, is located out of the protesters' reach in Baghdad's heavily fortified Green Zone.
It was closed in 1990 after the Iraqi invasion of Kuwait, and its reopening came as relations thawed under Abadi, signalling that the two countries would try to cooperate against Islamic State. Saudi Arabia is nominally part of a U.S.-led coalition targeting Islamic State with air strikes.
Earlier this week, Iraqi Foreign Minister Jaafari reassured his counterpart in Riyadh that the Saudi embassy in Baghdad was safe and would not meet the same fate as the embassy in Tehran.
The Iraqi government is trying to walk a middle line between Iran and the Sunni-ruled Arab countries in order to keep momentum against Islamic State, said Mona Alami, a Beirut-based analyst at the Atlantic Council think-tank.
"Abadi needs all the allies he can get," she said.
Abadi has declared 2016 the year of "final victory" against Islamic State, the ultra-hardline Sunni militant group that proclaimed a caliphate in 2014 over large sections of Sunni-populated territory in Iraq and Syria.
Winning over Iraq's Sunni population from Islamic State has been a key component in Abadi's strategy of framing the war against the militants as a campaign against terrorism rather than a continuation of decade-long Sunni-Shi'ite fighting.
His approach scored its first major success in the final days of 2015, when the Iraqi army, backed by U.S-led coalition air strikes and a Sunni tribal force, dislodged the militants from the centre of Ramadi, the capital of the western province of Anbar.
Until then, it was the Iranian-backed Shi'ite militias that had led the fight against Islamic State. They were kept from the battlefield in Ramadi to reassure the Sunni population.
"Abadi is caught between two fires: the Sunni hardliners and the Shi'ite hardliners," said Mustafa Alani, the United Arab Emirates-based director of security and defence studies at the Gulf Research Center think-tank.
Speaking alongside Jaafari, Iran's foreign minister Zarif accused Saudi Arabia of rebuffing Iran's offers to cooperate on "terrorism and extremism". Iranian President Hassan Rouhani accused Riyadh of fuelling regional tensions.
"Saudi Arabia is trying to cover up its defeats and domestic problems by creating tension in the region," Rouhani said in a speech broadcast on Iranian state television on Wednesday. (Additional reporting by Bozorgmehr Sharafedin, Saif Hameed, Stephen Kalin and Aref Mohammed; Editing by Andrew Heavens and Peter Graff)