In November 1959, the Irish Minister for External Affairs, Frank Aiken, first proposed an international agreement to halt the increase in nations with nuclear weapons with a view to eventual disarmament. This United Nations General Assembly adopted the proposal in resolution 1380 (XIV), which suggested
.. that the ten-nation disarmament committee [...] should consider appropriate means whereby this danger may be averted, including the feasibility of an international agreement, subject to inspection and control, whereby the Powers producing nuclear weapons would refrain from handing over control of such weapons to any nation not possessing them and whereby the Powers not possessing such weapons would refrain from manufacturing them.
The next year, again by the initiative of Aiken, the UN General Assembly adopted resolution 1576 (XV) that called upon the countries with nuclear weapons to voluntarily halt the proliferation of such devices.
In 1961, the Assembly adopted a further two resolutions: the first, 1664 (XVI), initiated by Sweden about the conditions of the agreement; the second, 1665 (XVI), was another Irish initiative to put the onus on those states with nuclear weapons to conclude an agreement. In 1965, three years after the world was brought to the brink of nuclear war during the Cuban Missile Crisis, the USA and then USSR both submitted draft treaties to the United Nations Disarmament Committee. That same year, eight non-aligned states initiate the adoption of resolution 2028 (XX), which listed the five principles that would form the basis of the treaty. The next year the United Nations General Assembly adopted two more resolutions to maintain the momentum towards the goal of an agreement: 2149 (XXI) and 2153 (XXI).
In August 1967, the USA and USSR separately submit draft treaties with identical texts, and in December of that year the UN General Assembly adopts another resolution, 2346 (XXII), requesting that the Eighteen-Nation Committee on Disarmament report on its progress by March 1968. Two months before the report is due the USA and USSR submit a joint draft treaty, which, after a few amendments, is adopted by the Assembly in resolution 2373 (XXII)
On 1st July 1968, at separate ceremonies in London, Moscow and New York, representatives from sixty-two nations signed the treaty. Nevertheless, the treaty was not immediately brought into force. Various governments, including those of the Soviet Union and United States, needed to ratify the treaty. This process stalled because of the Russian invasion of Czechoslovakia, and was not completed until 5th March 1970 when the treaty finally came into effect. Today, 189 countries are party to the treaty with four notable exceptions: India; Israel; Pakistan; and, North Korea. The first three never ratified the treaty, whereas North Korea ratified it in 1985 but later withdrew.
The United Nations Disarmament website includes a page dedicated to the Non-Proliferation Treaty, which makes the text of the treaty available to download in pdf format in various languages.