TEHRAN, Iran -- Iran's parliament speaker said Sunday that an attack that killed 27 members of Iran's elite Revolutionary Guard was "planned and carried out from inside Pakistan," which he said should answer for it.

Ali Larijani's remarks, carried by the state-run IRNA news agency, came after Iranian officials initially accused Saudi Arabia and the United Arab Emirates of being behind the attack. The Gulf Arab states are deeply suspicious of Tehran and at war with Iran-aligned rebels in Yemen.

Iran's Foreign Ministry summoned Pakistan's ambassador on Sunday to protest the attack.

Pakistan condemned Wednesday's attack and its foreign minister, Shah Mahmood Qureshi, spoke with his Iranian counterpart, Mohammad Javad Zarif, by phone on Sunday to assure him that Pakistan would fully co-operate in the investigation, according to two government officials who spoke on condition of anonymity as they were not authorised to brief media.

The militant Sunni group Jaish al-Adl, which claimed responsibility, is believed to operate from havens in neighbouring Pakistan.

The head of Iran's powerful Revolutionary Guard, Maj. Gen. Mohammad Ali Jafari, on Saturday accused Pakistan's security forces of supporting the militants and said Iran expects it to "punish" them.

Iran's President Hassan Rouhani meanwhile vowed "revenge for the blood of these martyrs," in remarks broadcast Sunday on state TV.

"They cannot escape God's and Iranian people's vengeance," Rouhani said.

Pakistan is closely allied with Saudi Arabia but has tried to maintain a balancing act between Riyadh and Tehran. Saudi Arabia's Crown Prince Mohammed bin Salman is expected to visit Pakistan Sunday after delaying his arrival by one day without providing an explanation.