The US has had a tricky relationship with Pakistan over the years. The US is often seen to not be as "tough" on Pakistan as it is on other states, because Pakistan is a key American ally in the region. For both the Soviet-Afghan War, and the War in Afghanistan, Pakistan was a crucial staging ground and partner for US force projection in the region (covert or overt). And it is not always clear that Pakistan has been acting in accordance with US interests even while it receives substantial military aid from the US, leading some to call it "the ally from hell." This is just necessary background information to understand why the US has dealt with Pakistan different than it has, say, North Korea or Iran, neither of which are anything like US allies in their respective regions.
The US was aware of Pakistani nuclear ambitions as they accelerated in the 1970s, and pressured them to avoid them. This pressuring took three forms. One was to just tell them, "we know what you are doing, stop it." This was not all that successful — the Pakistanis would just deny that they were doing it and stall for time. The other was to pressure other states not to sell sensitive nuclear equipment to Pakistan — France in particular was a huge exporter of dual-use nuclear technology in the 1970s, and the US worked hard to halt certain sales that were planned. This was more successful, though the Pakistanis just found other venues for their acquisition of sensitive nuclear technology (including smuggling blueprints out of the Netherlands, famously). Third, they did impose some sanctions on Pakistan, but this was sometimes counterproductive because they were quite incomplete in scope, and often reversed when it became in the US interest to do so. And in the end, Pakistan was able to get considerable economic aid from China, who saw Pakistan as a useful ally to counteract India. So these sanctions had no noticeable effect on Pakistan's nuclear ambitions. (It is arguable that economic sanctions — used heavily against Iran and North Korea — are actually a useful non-proliferation tool in general. The threat of them might be more useful than the reality of them.)
The US intelligence community closely monitored Pakistan's progress and even did an unprecedented thing: they would show their classified intelligence to Pakistan's leaders, to show them how much the US knew about their work, as part of the effort to get them to stop doing the work. But it didn't stop them.
Unlike Iran and North Korea, the United States never threatened war or military strikes as a way to avoid a nuclear Pakistan, to my knowledge. Again, the US in effect talked out of two sides of its mouth on Pakistan because they were such a core geopolitical ally for the US.
Ultimately they did impose heavy sanctions on Pakistan following their 1998 nuclear tests, but these were reversed very shortly thereafter. You can read the link above for a summary of all of the various sanctions that have been put on and taken off. The sum effect of these has not been to slow Pakistan's nuclear armaments, but instead to drive Pakistan closer to China.
Pakistan's nuclearization was greeted with near universal dismay in 1998, because it raises the chance of a nuclear exchange in the region (their shared border with India is a major issue for both countries, and has resulted in live military hostilities even after both went nuclear), and because Pakistan's record on non-proliferation is exceedingly poor. One of their top scientists, A.Q. Khan, was discovered in the early 2000s to have been selling sensitive centrifuge technology and warhead design information to at least the Iranians, North Koreans, and Libyans. It has always been suspected that the highest levels of the Pakistani government must have been aware of this and thus at some level sanctioned it. One of the top fears of American intelligence analysts is that Pakistan might be willing to sell nuclear weapons to other states of similar ideological interest, like Saudi Arabia, or that extremist members of Pakistan's intelligence services might be willing to smuggle them to Islamic terrorists. At the same time, the geopolitics of the region has made it so that the US has attempted to maintain fairly good relations with Pakistan throughout these concerns.
For excellent coverage of US monitoring of Pakistan's nuclear program and their attempts to halt it, see Jeffrey Richelson, Spying on the Bomb, esp. chapters 8, 11, and 14.