Khan has struggled for months to control Pakistan’s rampant inflation, foreign debt and other economic woes. While many of his promised reforms and civic projects sputtered, he maintained a loyal following, especially among young Pakistanis. He rejected advice from military leaders, however, and lost allies to the opposition, which slowly gathered enough support to challenge his fitness for office.