In the 1997 elections, the conservative party secured a significant majority, enabling them to amend the constitution to reduce checks and balances on the Prime Minister’s power. Nawaz Sharif faced institutional challenges from key figures like President Farooq Leghari, Chairman Joint Chiefs of Staff Committee General Jehangir Karamat, Chief of Naval Staff Admiral Fasih Bokharie, and Chief Justice Sajjad Ali Shah. Sharif successfully countered these challenges, resulting in the resignation of all four, with Chief Justice Shah stepping down after the Supreme Court was stormed by Sharif's supporters.
Tensions with India escalated in 1998 following Indian nuclear tests (Operation Shakti). In response, Sharif convened a cabinet defense committee meeting and subsequently ordered Pakistan’s own nuclear tests in the Chagai Hills. This action, while internationally condemned, was popular domestically and heightened military readiness along the Indian border. Sharif's strong response to international criticism following the nuclear tests included condemning India for nuclear proliferation and criticizing the United States for its historical use of nuclear weapons in Japan:
The World, instead of putting pressure on [India]... not to take the destructive road... imposed all kinds of sanctions on [Pakistan] for no fault of her...! If Japan had its own nuclear capability...[the cities of]...Hiroshima and Nagasaki would not have suffered atomic destruction at the hands of the... United States
Under his leadership, Pakistan became the seventh declared nuclear-weapon state and the first in the Muslim world. In addition to nuclear development, Sharif’s government implemented environmental policies by establishing the Pakistan Environmental Protection Agency. Continuing Bhutto's cultural policies, Sharif allowed some access to Indian media, marking a slight shift in media policy.