ERBIL, Iraq- The prime minister of Iraq's semi-autonomous Kurdish region, Nechirvan Barzani, was sworn on Monday in as its president, filling the most powerful regional office, vacant since 2017 when his uncle quit after a failed independence bid.

Barzani's uncle Masoud Barzani was the only other person to have held the office since it was created in 2005, two years after the U.S.-led invasion that toppled dictator Saddam Hussein.

The younger Barzani, whose Kurdistan Democratic Party (KDP) won first place in a parliamentary election eight months ago, was elected president by the new parliament last month.

The vote was boycotted by the KDP's main regional rivals, the Patriotic Union of Kurdistan (PUK). The two parties, foes during the Saddam era, have shared power in the region since the U.S.-led invasion, but have been at odds lately over the allocation of posts in the regional government.

Masoud Barzani, still the head of the KDP, stepped down after 12 years as regional president in November 2017, less than a month after a referendum on independence backfired, triggering a military offensive from Baghdad and a crisis for Iraq's Kurds.

During the time the post was vacant, the president's powers were divided between the prime minister, parliament and the judiciary in a makeshift arrangement, leaving the future of the presidency uncertain.

The post has long been a source of tension among Iraq's Kurdish political parties. Some have called for the region to adopt a parliamentary system and abolish the presidency.

The semi-autonomous region does not have a formal constitution, having failed to ratify it in parliament since it was drafted in 2009.

Barzani is expected to nominate his cousin, Masrour Barzani, now security chief, to replace him as prime minister.

Monday's swearing-in ceremony was attended by Iraq's President Barham Salih and Speaker of the House Mohammad al-Halboosi, among other Iraqi officials.

Salih is a leading figure in the PUK. Since Iraq's post-Saddam constitution was set up, the Iraqi presidency has been held by a Kurd from the PUK, while the rival KDP has held the presidency of Kurdistan.

(Reporting by Raya Jalabi Editing by Peter Graff) ((;))