At least two people have been killed after gunmen attacked a packed mosque in the Afghan capital Kabul.

Initial reports said the cleric performing the prayer service and a security guard were killed.

Police said the armed men were still inside the building, which was crowded with Shiite worshippers during Friday prayers.

Mir Hussain Nasiri, a member of Afghanistan's Shiite clerical council, said the attackers have taken over a section of the mosque with separate prayer areas for men and women.

Security forces have surrounded the mosque, which is in the north of the city.

A police official initially said the forces were holding back to prevent more casualties.