The man regarded as the "father of Pakistan's nuclear bomb", Dr Abdul Qadeer Khan, has died aged 85 after being hospitalised with Covid-19.
Dr Khan was hailed as a national hero for transforming his country into the world's first Islamic nuclear power.
But he was also notorious for having smuggled nuclear secrets to states including North Korea and Iran.
Prime Minister Imran Khan said Pakistan had lost a "national icon".
"He was loved by our nation bec[ause] of his critical contribution in making us a nuclear weapon state," the prime minister tweeted.
Known as AQ Khan, the scientist was instrumental in setting up Pakistan's first nuclear enrichment plant at Kahuta near Islamabad. By 1998, the country had conducted its first nuclear tests.
Coming shortly after similar tests by India, Dr Khan's work helped seal Pakistan's place as the world's seventh nuclear power and sparked national jubilation.
But he was arrested in 2004 for illegally sharing nuclear technology with Iran, Libya and North Korea.
The revelations that he had passed on nuclear secrets to other countries shocked Pakistan.
In a televised address, Dr Khan offered his "deepest regrets and unqualified apologies".
Dr Khan was pardoned by Pakistan's then-president, Pervez Musharraf, but he was held under house arrest until 2009.
The leniency of his treatment angered many in the West, where he has been dubbed "the greatest nuclear proliferator of all time".
But in Pakistan he remained a symbol of pride for his role in boosting its national security.
"He helped us develop nation-saving nuclear deterrence and a grateful nation will never forget his services," President Arif Alvi said.
The fact AQ Khan could be described as one of the most dangerous men in the world by Western spies but also be lauded as a hero in his homeland tells you much about not just the complexity of the man himself but also how the world views nuclear weapons.
AQ Khan was responsible, perhaps, more than any other individual for aiding the spread of nuclear weapons technology. He helped his own country's nuclear programme but then spread some of the know-how to others, including Iran, North Korea and Libya. The extent to which this was motivated by money, ideology or orders from Pakistan's leadership has always been murky.
For Western countries stopping the spread of nuclear weapons has been a top priority, and the CIA and MI6 helped take down Khan's network.
But within Pakistan he was a revered figure, seen as having helped build his country's defences against India.
And more broadly, he and others would question why Western countries should be allowed to have nuclear weapons for their security while denying the same ability to others.