Iraqi parliament elects Fouad Massoum, a senior Kurdish politician as president. Political leaders move a step closer to forming a new government. (Reuters)

A veteran Kurdish politician was elected president of Iraq on Thursday, as political leaders moved a step closer to forming a new government that will face the momentous task of repairing the deep divisions that are tearing the country apart.

Fouad Massoum received 211 of 269 votes in the Iraqi parliament after Kurds presented him as their candidate. Under an informal power-sharing agreement, the role of president goes to a Kurd, the job of speaker of parliament to a Sunni, and the position of prime minister to a Shiite.

Massoum’s election starts the clock ticking on the thornier issue of choosing a prime minister, as pressure mounts on the incumbent, Nouri al-Maliki, to step aside. Lawmakers now have 15 days to name a prime minister, according to the constitution.

The United States and other countries are urging Iraqis to move rapidly to form a new government after advances by the Sunni extremist group that calls itself the Islamic State. It has taken over large swaths of Iraq in an offensive that began last month.

While that battle has slowed into a stalemate, the Islamic State has ramped up a bombing campaign in Baghdad. Two car bombs blew up in the busy commercial district of Karrada on Thursday evening, killing at least 15 people, according to Al Sumaria television. The Associated Press put the death toll at 21. The bombs went off near a Shiite congregation hall, residents said.

A shooting and bombing attack on Thursday near Baghdad on a bus transporting prisoners from a military base left 52 prisoners and nine police officers dead. (Reuters)

Earlier in the day, more than 50 prisoners were killed after an attack by the Islamic State in Taji, 15 miles northwest of Baghdad, Iraqi security officials said. One security official at Taji, who declined to be identified because he was not authorized to speak to the press, said the prisoners had been “caught in the crossfire” as Islamic State militants attempted a jailbreak. However, human rights groups have accused Iraqi security forces and Shiite militias of executing Sunni prisoners to prevent them from escaping.

Massoum, whose name also is spelled Massum, served as the first prime minister of Iraq’s semiautonomous Kurdish region in 1992. He replaces his ally, Jalal Talabani, who has been president of Iraq since 2005 but had largely been absent from politics for the last year and a half as he recovered from a stroke. Both are founding members of the Patriotic Union of Kurdistan.

The party, which traditionally puts forward the candidate for president, had been deeply divided over whom to chose, postponing a parliamentary vote scheduled for Wednesday until party members decided on a nominee.