More than a year after Parliamentary elections, Iraqi MPs have finally elected Abdul Latif Rashid as the country's new president.
After being elected on Thursday, Mr Rashid nominated Mohammed Shia Al Sudani as prime minister.
The position of president is largely ceremonial and is traditionally held by a Kurd.
Mr Rashid won against incumbent Barham Salih, who was running for a second term.
The US State Department issued a statement welcoming the end of the deadlock.
"As Iraq’s political leaders form a new government, we encourage them to bear in mind the will of the Iraqi people, who voted for a government responsive to their needs. The United States urges all parties to refrain from violence and to resolve differences amicably and peacefully through the political process," it said.
He now has 30 days to form a government.
Who is Abdul Latif Rashid?
Mr Rashid, 78, is a veteran politician, having served in high positions of government throughout his career.
Born in the northern city of Sulaymaniyah, in the Iraqi Kurdish region, he began his political career in his 20s after joining the Patriotic Union of Kurdistan party.
Mr Rashid achieved his degree in civil engineering from the University of Liverpool in the UK and continued his education there, earning a master's degree and a doctorate in engineering from the University of Manchester.
He then became Iraq's minister of water resources from 2003 to 2010, before being appointed as a senior adviser in the PUK by the late president Jalal Talabani, who was also the founder of the group and Mr Rashid's brother-in-law.
Mr Rashid was elected with 162 votes in a second round of voting on Thursday.
He had received 156 votes in the first round — short of the two-thirds majority needed to win. Mr Salih received 99 votes in both rounds.
Who is Mohammed Shia Al Sudani?
Now a prominent name among Shia circles, Mr Al Sudani was born in the country's capital, Baghdad, in 1970.
He attended the University of Baghdad, where he studied agricultural science and then project management.
His earliest brush with politics came when he joined the Islamic Dawa Party and took part in the 1991 uprisings against Saddam Hussein, president at the time, following the First Gulf War.
In 2004, Mr Al Sudani was appointed mayor of Amarah city, in south-eastern Iraq.
Mr Al Sudani comes from a well-known tribe in the southern province of Maysan, where he served as governor for a year.
In 2010, he was appointed human rights minister and a year later, briefly served as chairman of the Justice and Accountability Commission, which banned candidates linked to Saddam Hussein's Baath party from holding positions in government.
Mr Al Sudani also ran for election with the State of Law Coalition, which was led by former prime minister Nouri Al Maliki, with whom he has close ties.
The coalition is part of the Co-ordination Framework, that holds almost 40 seats in Parliament.
Last year, Mr Al Sudani created the Al Foraten Movement.