Suspected Islamic militants have attacked security forces on both sides of the Afghanistan - Pakistan border .