Massoud Barzani, the president of the autonomous Kurdish region in Iraq, told a closed-door session of parliament Sunday he was stepping down amid the fallout from a controversial independence referendum.

"After November 1, I will no longer exercise my functions, and I reject any extension of my mandate," the 71-year-old said in a letter read out to parliament in the Kurdish capital Erbil, a copy of which was obtained by AFP.

"Changing the law on the presidency of Kurdistan or prolonging the presidential term is not acceptable," said the architect of the 25 September independence vote, which led to the Kurds losing disputed territory to Baghdad's forces and oil fields to which they laid claim.

I will 'remain a Peshmerga (Kurdish fighter) among the ranks of the people of Kurdistan and I will continue to defend the achievements of the people of Kurdistan

- Massoud Barzani, Kurdistan president

"I ask parliament to meet to fill the vacancy in power, to fulfil the mission and to assume the powers of the presidency of Kurdistan," said the letter.

Barzani also said he would "remain a Peshmerga [Kurdish fighter] among the ranks of the people of Kurdistan, and I will continue to defend the achievements of the people of Kurdistan".

Demonstrators, some carrying clubs, stormed the parliament building, angry at the decision of Barzani to step down from the presidency of the region, witnesses said.

Gunshots were heard as protesters who claimed they were "Peshmerga" Kurdish fighters forced their way inside the building, they said.

Sunday's parliamentary session was held behind closed doors because of "sensitive questions" that would be discussed, deputies said earlier.

Officials from Barzani's Kurdistan Democratic Party (KDP) had told journalists ahead of the session that the letter to be read out would announce he was stepping aside.

Simmering tensions

Barzani's letter was sent to parliament to decide on the provisional redistribution of the presidency's powers until a presidential election, for which a date has yet to be fixed.

November 1 had originally been slated for both presidential and legislative elections in the Kurdish region of northern Iraq, but these were postponed in the political and military chaos that followed the referendum - which returned a massive "yes" to independence.

The start of Sunday's parliamentary session was postponed several times amid political tensions.

Iraqi children greet soldiers in Kirkuk (Reuters)

The opposition Goran party which had sought Barzani’s resignation and a "government of national salvation" opposes the redistribution of the presidency's powers proposed by the major Kurdish parties, the KDP and its rival Kurdish Patriotic Union (PUK), deputies said.

Barzani "symbolises the failure of Kurdish politics, and the only thing left for him to do is to issue a public apology," Goran MP Rabun Maarouf said before the session began.

Barzani had come under growing opposition from his detractors after he organised the 25 September referendum on Kurdish independence that triggered a deep crisis with Baghdad.

The federal government deemed the vote unconstitutional, and its forces have since seized disputed territory in the north from Kurdish fighters.

Territory reclaimed from the Kurds in the sweeping operation included key oil fields in and around the disputed province of Kirkuk.

Push for dialogue

The loss of the oilfields, which provided income that would have been critical to an independent Kurdish state, sparked recriminations among the Kurds.

Political life in Kurdistan is dominated by the KDP and PUK of Iraq's late president Jalal Talabani.

Iraq's current president, Fuad Masum, is also a PUK member and had backed a push for dialogue between the Kurds and Baghdad before the referendum.

After the vote, Masum said the referendum had triggered the assault on Kirkuk.

Iraq's neighbours Turkey and Iran, which have their own Kurdish minorities, also strongly opposed the non-binding vote, and Ankara on Thursday said the Iraqi Kurdish offer for the referendum to be frozen was "not enough," instead urging the Erbil government to cancel it.

French President Emmanuel Macron has urged dialogue between Baghdad and the Kurds, telling Prime Minister Haider al-Abadi in a phone call Saturday that "everything possible should be done to avoid fighting between Iraqis," the presidency in Paris said.

Barzani's move on Sunday comes with Abadi's forces engaged in battles in the west with holdout militants of the Islamic State group, assaulting what the premier called "the last den of terrorism in Iraq," al-Qaim, on the border with Syria.