Newly re-elected Iraqi President Jalal Talabani has reappointed Shia leader Nouri Maliki as prime minister.
The move comes after a deal was reached to end the months of political deadlock which followed inconclusive elections.
But the event was marred by a walkout by al-Iraqiyya, the main Sunni-backed alliance led by former PM Iyad Allawi.
They said Mr Maliki had reneged on an agreement to reinstate four Sunni leaders who had been banned for alleged ties to Saddam Hussein's Baath party.
US President Barack Obama welcomed Thursday's events in the Iraqi parliament.
"The president is encouraged by the substantial progress that has been made in forging an inclusive government that represents the Iraqi people and the results of this year's election," said a White House statement.
The White House added that the US president had spoken to several Iraqi leaders in the run-up to the parliamentary session.
'Stabbed in the back'
Iraq's parliament convened after a delay of several hours on Thursday.
Their first act was to hold secret ballot which appointed Osama Nujaifi - a Sunni and a member of Mr Allawi's al-Iraqiyya coalition - as speaker.
MPs were then due to vote on reappointing Mr Talabani as president. But before the vote could be held, about a third of the al-Iraqiyya MPs - including Mr Nujaifi and Mr Allawai - walked out of the parliament.
The BBC's Jim Muir in Baghdad says the al-Iraqiyya members had wanted parliament to pass a motion to remove the stigma of Baathism which had barred four of the coalition's key figures from taking political office.
Although not opposed to Mr Talabani's re-election itself, they had wanted the motion to be passed before the election of the president.
"We boycotted the session because we showed good intentions to others, but they stabbed us in the back," Saleh al-Mutlak, one of the barred lawmakers, told the AFP news agency.
"We will not return without international guarantees," he added, but gave no further details.
But despite the walk-out, the parliamentary session continued and MPs went on to re-elect Mr Talabani.
"Today is the day of victory. The victory of the true Iraqi will," Mr Talabani told parliament.
As had been agreed in the deal reached on Wednesday, Mr Talabani then handed the task of forming a government to the leader of the largest coalition, Mr Maliki.
Mr Maliki now has a month to put together a cabinet, during which efforts will be made to draw Mr Allawi back into the process, says our correspondent.
Under the power-sharing deal - struck late on Wednesday - Mr Allawi will head a new council for national strategy. Al-Iraqiyya will also get the foreign ministry.
Iraq has seen eight months of political deadlock, after there was no clear winner in elections in March. Negotiations to form a new government reached a stalemate after March's election results were announced.
Mr Allawi's al-Iraqiyya bloc won two more seats than Mr Maliki's State of Law party, but neither had enough seats to form a government.
The tide turned for Mr Maliki in early October when the militant young Shia cleric Moqtada Sadr announced that the 40 or so seats he controls in the new parliament would back the incumbent for a second term.
Our correspondent says that many Iraqis are now cautiously hopeful that they are on the road to a stable government which includes all the main factions and could turn the corner to a better future for the whole country.