Prime Minister Imran Khan has sought to position Pakistan the cooler head in a confrontation that has put the world on edge.