The "Islamic State" claimed responsibility for the attack on Pakistan's embassy in Kabul, according to a statement by one of the militant group's affiliated channels on Telegram said on Sunday.
The embassy in the Afghan capital was attacked on Friday with gunfire, injuring a Pakistani security guard and causing some damage to the building.
IS said two of their members were armed with "medium and sniper weapons," and were targeting the Pakistani ambassador and his guards in the courtyard.
In a statement cited by jihadist monitor SITE, the "Islamic State's" regional chapter said it had "attacked the apostate Pakistani ambassador and his guards."
Authorities condemn the attack
Islamabad has called it an assassination attempt. Pakistani Prime Minister Shehbaz Sharif has called for an investigation into the incident.
A spokesperson from Kabul's police force said authorities arrested one suspect and recovered two light weapons from a nearby building.
An embassy official told the AFP news agency a lone attacker "came behind the cover of houses and started firing," but that the ambassador and other staff were safe.
The Afghan Foreign Ministry condemned the attack and added, "The Islamic Emirate of Afghanistan will not allow any malicious actors to pose a threat to the security of diplomatic missions in Kabul."
Pakistan does not officially recognize the Taliban government, but the country has kept its embassy open in Kabul and maintains a full diplomatic mission.
Ties between Pakistan and the Taliban are complicated, as Islamabad has been accused of supporting the group.
After the Afghan Taliban took over last year, more than a million people have crossed the border and sought refuge in Pakistan.