The Islamic State group’s affiliate in Afghanistan claimed responsibility for in a statement posted in social media channels linked to the group.