ERBIL, Iraq (Reuters) - Their common enemy is Islamic State, but Iraq's Kurds are preoccupied by a struggle within their autonomous region, where political parties are jousting over the presidency and their supporters are invoking an old civil war.

Several factions that hold the balance of power say they will only agree to extend President Massoud Barzani's mandate to avoid a leadership vacuum if the entire system is overhauled in a way that would ultimately reduce his authority.

Barzani, 68, a veteran guerrilla leader who fought against dictator Saddam Hussein for decades, has ruled the region since its presidency was established in 2005. His Kurdistan Democratic Party (KDP) rejects the proposed reforms.

The power struggle is putting Kurdish unity to the test at a time of acute economic hardship, when Iraq itself is being pulled apart by Islamic State. The disunity undermines the Kurds' ability to capitalize on the fragmentation of the country and pursue their longterm dream of independence.

"Today, Kurdistan is going through an exceptional and important phase," Barzani said in a speech last week addressing the debate surrounding his presidency. "Now more than ever before, we need our ranks to be united".

The divisions go back decades and culminated in civil war among Kurds during the 1990s, between the KDP and another Kurdish party, the Patriotic Union of Kurdistan (PUK).

Since Saddam was toppled in a 2003 U.S. invasion, the two parties have largely cooperated to run the Kurdish region under a strategic agreement, sharing government posts between them and using their joint majority in the region's parliament to maintain the status quo.

While Barzani has held the top post within the region, a PUK leader has served in Baghdad as president of Iraq, a largely ceremonial post set aside for a Kurd in the post-Saddam order.

The KDP mainly predominates in western Kurdish provinces, while the PUK dominates in the east. The two parties run parallel administrations and each have their own units of the region's security forces, known as peshmerga.

But with the issue of the presidency whipping up rivalries, some of their more zealous supporters are now invoking the history of war between them.

Pro-PUK websites released old video of an interview with Barzani after he received help from the hated Saddam to recapture Erbil from the PUK in the 1990s. KDP supporters, meanwhile, have superimposed pictures of the Iranian flag over rival politicians to paint them as puppets of Tehran.

Renewed conflict is almost unthinkable, but the 1990s "war of fratricide" has left a profound imprint on the Kurdish regional government, known as the KRG. Most senior politicians are former guerrillas who fought in repeated uprisings against the Iraqi government before turning their guns on each other, and to this day nurse grudges.

"These internal fissures have side-tracked the KRG and political parties from capitalizing on a weak Baghdad and international support against ISIS," said Bilal Wahhab, assistant professor at the American University of Iraq, Sulaimaniyah.

Baghdad lost control of nearly a third of the country to Islamic State last summer, allowing the Kurds to expand their territory in the north unopposed, while doubts about the future of Iraq as a unified state have strengthened their case for independence.

For Barzani, the chaos presents an opportunity to secure his legacy by leading the region towards statehood.

Disunity, however, “has already undermined a lot of the efforts President Barzani has made for greater sovereignty", said Dlawer Ala'Aldeen, president of the Middle East Research Institute (MERI), a Kurdish think-tank. “These efforts include lobbying in Washington and Europe for recognition and direct political, military and economic support."

Having held their ground against Islamic State, the peshmerga have emerged as the most reliable partner on the ground in Iraq for the U.S.-led coalition against Islamic State, earning military support and raising the Kurds' profile abroad.

“The Kurds have won significant international respect for their role in the fight against ISIL," said a Western diplomat, using one of the English acronyms for Islamic State. "If they cannot come to agreement their standing could suffer”.

Factionalism also makes the region susceptible to manipulation by its neighbors, whose competing agendas in Iraq and the wider Middle East converge on keeping Kurdish ambitions in check.

KDP supporters have framed their domestic rivals' campaign to change the political system as an Iran-backed scheme to undercut Barzani, who leans more towards Turkey and represents an impediment to Tehran's interests in Iraq.

STATUS QUO

The question is how to distribute power in the region as it becomes more diffuse, and new parties such as Gorran (Change), vie for votes and resources.

In 2013, PUK lawmakers backed the extension of Barzani's presidency beyond a two-term limit, overriding the opposition, which decried the move as a coup against democracy and hurled water bottles at the speaker of parliament. This time however the PUK has turned its back on the KDP, lining up with Gorran and the region's Islamist block to demand that the president be elected by parliament rather than the people.

That would make the president accountable to the assembly, thereby weakening him and the Barzani family, which has been at the forefront of the Kurdish movement since World War II and is the KDP's backbone.

"The KDP has a lot more to lose than anyone else in this game," Ala'aldeen said.

For the other parties who have struggled to deliver on election promises, the presidency issue is also a "low cost, high yield" way to divert attention and regain lost credibility with the Kurdish public, Wahab said.

Despite the heated rhetoric diplomats and analysts expect a compromise to be found once the other parties have squeezed as much as they can from the KDP in return for renewing Barzani's presidency for another two years.

If that is the outcome, the region's constitution, which is currently being re-drafted, may allow Barzani to run for office again when his term next expires, potentially setting the stage for further challenges and deadlock in future.