A pair of gunmen stormed a Shiite mosque in a suburb of the Afghan capital early Thursday morning but were shot dead by Afghan security forces after wounding three worshipers at the pre-dawn service.

Officials of the Afghan intelligence service said the gunmen were members of an extreme Sunni militant group, Lashkar-e-Jhangvi, which is based in Pakistan and has carried out numerous sectarian attacks on Shiite mosques and communities there.

In a statement, the officials said their agency had followed the assailants for hours before the attack. They said the men were heavily armed and were disguised in Afghan police uniforms. In a second statement, they said Pakistani intelligence agencies were also involved in the assault.

Leaders of Lashkar-e-Jhangvi claimed responsibility for an attack on Shiite mourners at a religious ceremony in Kabul in 2011 in which more than 50 people were killed and scores wounded. No group immediately said it had carried out Thursday’s attack.

Afghan officials said the 2011 mosque massacre, the first incident of its kind in Afghanistan, was intended to sow sectarian tensions in this Sunni-dominated country. It was quickly disavowed by Taliban insurgents.

The second statement Thursday by officials of the National Directorate of Security suggested that “the enemies of Afghanistan’s prosperity and tranquility,” including some “elements in Pakistan's intelligence” and Pakistani ethnic Punjabis, were seeking to use “religious discord” to incite Afghans to mistrust and fight each other.

Pakistani officials have not commented on the incident.

The accusations by Afghan officials came just days after Afghan President Hamid Karzai visited Pakistan and met with its new prime minister, Nawaz Sharif, in hopes of winning Pakistani support for reviving peace talks with Taliban insurgents. He returned to Kabul with no public sign of progress.

The Afghan government has regularly accused Pakistan, especially its intelligence services, of sheltering Taliban insurgents and supporting them in attacks on Afghan and NATO troops. Pakistan denies the allegations.