BAGHDAD - The head of the Iraqi parliament's biggest Sunni Muslim bloc was killed at a mosque on Friday, officials said, an assassination which could undermine efforts for sectarian reconciliation in Iraq.

The killing coincided with coalition negotiations by parties before parliamentary polls due in January, seen as a key test of whether Iraq's Sunnis, Shi'ites and ethnic Kurds can live at peace after years of bloodshed since the 2003 U.S. invasion.

Harith al-Ubaidi, head of the Accordance Front, and a member of the parliament's human rights committee, was leaving a mosque in west Baghdad after Friday prayers when he was killed.

He was at a mosque. An armed man shot him with a pistol, then threw a grenade at him inside the Al-Shawaf mosque, said Saleem al-Jubouri, a spokesman for the Accordance Front.

It could be al Qaeda behind this event or another armed group. This shows that the security situation is still fragile and dangerous. The government must provide more security, he added.

Accounts of the assassination varied.

A witness said the attacker was a suicide bomber, who ran up to Ubaidi and hugged him before detonating one or more grenades.

Police said six people were killed, including the attacker, after the assassin opened fire randomly on worshippers before detonating a grenade. They said the attacker, aged from 15 to 18 years old, shot Ubaidi twice in the head.

Assassinations of political leaders have a huge effect on national peace, and these acts are meant to stoke renewed sectarian strife between Sunnis and Shi'ites, and also within feuding factions among the Sunnis, said Hazim al-Nuaimi, a political analyst at Baghdad University.

Prime Minister Nuri al-Maliki warned on Thursday of the likelihood of increasing violence before next year's election. The withdrawal by U.S. combat troops from urban centers by the end of the month is another flashpoint for increasing attacks.

(Additional reporting by Waleed Ibrahim, Khalid al-Ansary and Muhanad Mohammed, Writing by Mohammed Abbas; Editing by Charles Dick)