Iraqi Kurdish politician Abdul Latif Rashid became the fourth president of Iraq after he was selected to replace Barham Saleh in a parliamentary vote on Thursday.
Rashid's election paves the way for the formation of a new government after a yearlong deadlock.
Rashid, 78, is a British-educated engineer and was the Iraqi minister of water resources from 2003-2010.
He won more than 160 votes against 99 for the incumbent Saleh, an assembly official said.
Rashid's first task was expected to be nominating a candidate for prime minister to replace the current caretaker premier, Mustafa al-Kadhimi, and attempt to form a new government for the crisis-hit nation.
A favored candidate for the prime minister's post was Mohammed Shia al-Sudani, 52, of the Shiite Muslim bloc the Coordination Framework, which includes pro-Iranian former paramilitary groups.
When Sudani was first proposed in July, this sparked mass protests by backers of his Shiite rival, the fiery populist and cleric Muqtada al-Sadr, whose followers breached the Green Zone and stormed Parliament.
A new reminder of Iraq's troubles came Thursday as the lawmakers headed into Parliament, when a barrage of nine Katyusha-style rockets rained down on the area, the security forces said.
At least 10 people were wounded, including six members of the security forces or bodyguards of lawmakers, as well as four civilians in a nearby district, a security official told Agence France-Presse (AFP).
U.S. Ambassador Alina Romanowski condemned the attack "in the strongest terms" on Twitter and warned that "the people of Iraq must resolve their political differences & grievances solely thru peaceful means."
"Attacks like these undermine democracy & trap Iraq in a perpetual cycle of violence."