A SHOOTING and bombing attack on a bus near Baghdad has killed 52 prisoners and nine policemen as politicians faced pressure to form a power-sharing government that can tackle a Sunni insurgency.

The bus was transporting prisoners from a military base in the town of Taji to Baghdad when it was hit by roadside bombs. Gunmen then opened fire.

Much of Iraq's recent bloodshed is linked to sectarian divisions that have deepened since Sunni militants formerly known as the Islamic State of Iraq and the Levant (ISIL) seized large swathes of northern Iraq last month and declared an Islamic empire.

Sunni militants have been carrying out attacks around the southern edge of Baghdad while in response, Shi'ite militias have been active in rural districts of Baghdad, abducting Sunnis they suspect of militancy. Many later turn up dead.

The tit-for-tat attacks have escalated dramatically since the Sunni militant advance towards Baghdad, the most serious challenge to the Shi'ite-led government of Prime Minister Nuri al-Maliki since the withdrawal of US forces in 2011.

Iraq's parliament yesterday elected senior Kurdish politician Fouad Masoum as president, the second step in the process of forming a government.

Politicians have been in deadlock over forming a new government since an election in April.