Image copyright Getty Images

Jalal Talabani was the first non-Arab to become president of Iraq and a leading advocate of the rights of the Kurdish people.

Known as "Mam Jalal" (Uncle Jalal) by his supporters, he was elected to office two years after the overthrow of Saddam Hussein by US-led forces in 2003.

It followed decades of conflict and disputes between his Patriotic Union of Kurdistan (PUK), Iraq's central government and rival Kurdish groups.

Later, he used his position to act as a mediator between Iraq's various sectarian and ethnic groups, keeping a distance from all political parties.

Autonomy deal

Jalal Talabani was born in 1933 in the village of Xelekan in what is now Sulaimaniya province.

By the age of 13, he had formed a secret student organisation aimed at fighting oppression of the Kurdish minority by the Iraqi government. He was forced into hiding to avoid arrest.

Five years later, he was serving on the central committee of the Kurdistan Democratic Party (KDP), going on to lead resistance against Iraqi government incursions into Kurdish areas.

In March 1970, the KDP signed an agreement with the Iraqi government giving the Kurds an autonomous region and allowing Kurdish to be taught in their schools.

Image caption Despite the smiles there was to be no agreement with Saddam Hussein

But within four years neighbouring Iran, which had largely bankrolled the Kurdish movement, had withdrawn its support for the KDP, Baghdad had reneged on key parts of the peace deal, and the Kurdish group was plunged into crisis.

In 1975, Talabani formed the PUK, aimed at organising resistance inside Iraq. The move split the Kurdish movement and led to many years of rivalry between the PUK and KDP.

During the Iran-Iraq war, the KDP allied itself with Iran while the PUK remained neutral.

In 1983, the Iranians took the north-eastern border town of Hajj Umran with the help of the KDP. In response, Saddam Hussein formed an alliance with the PUK in return for their help in driving the Iranians out.

However, Talabani's hopes that he could force Saddam into a new deal for Kurdish autonomy were dashed. The Iraqi leader refused to allow the oil-rich city of Kirkuk to be included in an autonomous Kurdistan or for the Kurds to receive a fixed percentage of oil revenue.

Saddam's revenge

When the Iran-Iraq war ended, Saddam exacted revenge for the Kurdish rebellion. He embarked upon the Anfal (Spoils of War) campaign, in which thousands of Kurdish villages were razed and hundreds of thousands of Kurds were arrested, deported or killed.

As many as 5,000 Kurds died in the poison gas attack on Halabja, which Talabani described as "an Iraqi war of genocide against the Kurdish people".

In the 1991 Gulf War, Talabani helped inspire resistance against Saddam, hoping that the US would overthrow the president. Kurdish forces advanced to within 90 miles (145km) of Baghdad.

Image caption Thousands of Kurds fled after Saddam Hussein's offensive following the Gulf War

But after the Americans and their allies had withdrawn without taking the Iraqi capital, Saddam began another intense military campaign against the Kurds.

More than a million Kurds fled into the mountains after Turkey closed its borders to refugees. Eventually the coalition forces set up safe-haven refugee camps on the Iraqi side of the border and protected them from the Iraqis with a no-fly zone.

In April 1991, Talabani and KDP leader Massoud Barzani agreed a ceasefire and travelled to Baghdad to negotiate with the Iraqi leader.

But the two Kurdish leaders fell out again when Mr Barzani made an agreement with Saddam that once more made no provision for sharing Iraq's oil money.

Deal-broker

In 1992, still disagreeing over relations with Baghdad, the Kurdish factions held elections. But the vote resulted in stalemate and the Kurdish leaders were soon at loggerheads again.

By the time the US-led coalition was planning its invasion of Iraq in 2003, Talabani and Massoud Barzani had decided to co-operate.

Both leaders resisted American pressure for Turkish troops to enter Iraq, and both eventually agreed to turn over control of foreign policy, defence and monetary policy to Baghdad in return for retaining self-government in other policy areas.

This angered those Kurds, who believed it was time to press for full independence. But Talabani insisted that the Kurdish leadership was being realistic in settling for semi-autonomy within a new democratic Iraq.

In January 2005, Talabani was appointed Iraq's interim president, after helping negotiating the transitional administrative law, Iraq's interim constitution.

A year later, he was elected for a second term, in so doing becoming the first president elected under Iraq's new constitution.

In November 2010, he was again returned as president by MPs as part of a power-sharing deal agreed after eight months of deadlock following disputed elections.

He was instrumental in brokering the Irbil agreement of November 2010 between then Prime Minister Nouri Maliki and the Iraqiya bloc of Iyad Allawi.

Talabani called for national dialogue to resolve the differences between squabbling factions and drag Iraq out of the political quagmire.

But the process never took place, partly because of Talabani's deteriorating health. In 2008, he underwent heart surgery in the US, and in December 2012 the president suffered a stroke, which eventually forced him to stand down.

It marked the end of the political career of a man who had done more than most to try to bring together Iraq's disputatious political factions after the fall of Saddam.