Pakistan has committed itself to fighting Islamic militancy in its tribal areas , while discouraging the United States from undertaking military operations on its territory .