I just finished Seymour Hersh's book Chain of Command--The road from 9/11 to Abu Ghraib, and it contains a section on Pakistan which emphasizes the role that Pakistan played in helping other countries develop nuclear capability. In 1997 Pakistani nuclear scientist A.Q. Khan began assisting North Korea in restarting its nuclear weapons program, which it had abandoned years earlier. Khan was largely responsible for Pakistan's nuclear weapons program, and beginning in the 1990's he oversaw a black market in nuclear proliferation. Hersh cites several sources in the book who claim that Khan couldn't have done this alone--that he most likely was assisted by Pakistan's military.
Khan made numerous trips to Pyongyang, and in exchange for nuclear know-how, Pakistan got sophisticated long-range rockets from North Korea. In his January state of the union speech in 2002, Bush famously accused Iran, Iraq and North Korea of being an Axis of Evil, in regard to those countries support of terrorism and/or proliferation activities. The bad news for the Bush team back then was that by June of that year North Korea's restarted nuclear program was discovered, or they began learning about it, and this was the same time that the push for war with Iraq was going on. By late 2002 a crisis was developing over North Korea's refusal to stop enriching uranium. But it was a crisis that had to be swept aside so that the media and the public would focus on Iraq. The spectre of a mushroom cloud appeared in speeches and commentary by people like Condi Rice and Cheney when they spoke about Iraq in the latter part of 2002.
In February 2004 the Pakistani government put AQ Khan in front of t.v. cameras so he could confess to spreading nuclear weapons designs and material through his nuclear black market. It became known that Libya, Iran and North Korea had had dealings with Khan--had sought help developing a nuclear weapons program. Notably absent from the list of countries that Khan had dealt with was Iraq. At the time that it was invaded, Iraq was the least likeliest of the so-called rogue states to have an active nuclear weapons program.
Khan was pardoned by Pakistani dictator Pervez Musharraf, and in his book Hersh writes about a strange deal made between the Bush team and the Pakistani government. The deal was that the US wouldn't seek to arrest Khan or even question him about what he'd done, if Pakistan would let US forces conduct a special spring offensive in Pakistan to get Osama bin-Laden. Pakistan agreed to this, apparently, and even conducted its own offensive in the northwest part of Pakistan, against those believed to be al-Qaeda, in advance of the US offensive. Bin Laden of course managed to survive for another seven years.
Meanwhile North Korea was well on its way to having the bomb. By now it has conducted several nuclear tests and is rumored to have several nuclear weapons.