The attack took place late on Wednesday in ⁠the Hangu district near the Afghan border, an ​area that has long served as home to militant groups.