Having been the base for military operations that saw the Soviet Union defeated in Afghanistan in 1989 and, over a decade later in clashes with the West, during the US invasion of the Islamic Republic, which at the time was under Taliban rule, Pakistan has found it challenging, to say the least, in dealing with non-state armed groups and tribes that moved freely through its porous border.