A senior Sunni lawmaker was shot dead outside a mosque after Friday prayers in western Baghdad, officials said, underscoring fears that violence could rise ahead of Iraq's national elections next year.

Harith al-Obeidi, who led the main Sunni bloc in parliament, was killed as he was walking from the al-Shawaf mosque to his nearby home in the former insurgent stronghold of Yarmouk, police and a fellow lawmaker said.

The bold daylight shooting was the latest example of the militants' continued ability to stage attacks despite heightened security measures amid an overall decline in violence nationwide.

It came a day after Prime Minister Nouri al-Maliki warned that violence was likely to increase ahead of a June 30 deadline for U.S. troops to withdraw from urban areas as well as the national elections that are set for the end of January.

Al-Obeidi's party is the Congress of the People of Iraq, one of three parties making up the Iraqi Accordance Front, the main Sunni bloc in parliament. The other two parties in the bloc are the Iraqi Islamic Party and the National Dialogue Council.

A spokesman for the Accordance Front, Salim Abdullah, said al-Obeidi had recently taken over the bloc's leadership.

He said it appeared the gunman was on foot and acting alone but the investigation was continuing. However, a police official, who spoke on condition of anonymity because he wasn't authorized to release the information, said it was a drive-by shooting.

The mainly Sunni neighborhood Yarmouk was one of the most dangerous neighborhoods in Baghdad before local tribal leaders joined forces with the Americans against Al Qaeda in Iraq, helping to lead to the overall decline in violence.