Russia, China and developing nations supported the measure, giving it global clout and strong political backing.
The resolution calls for stepped up efforts to prevent the spread of nuclear weapons, promote disarmament and "reduce the risk of nuclear terrorism." It calls for better security for nuclear weapons materials and underscores the Security Council's intention to take action if such material or nuclear weapons get into the hands of terrorists.
The resolution consolidated many elements previously endorsed individually in the Security Council or other international forums. But bringing them together in a single document, voted on by global leaders, should add political momentum to efforts to achieve these goals, particularly at important conferences next year on nuclear security and on strengthening the Non-Proliferation Treaty.
It was only the fifth time the Security Council met at summit level since the U.N. was founded in 1945 and 14 of the 15 chairs around the council's horseshoe-shaped table were filled by presidents and prime ministers. Libyan leader Moammar Gadhafi's name was on the U.N.-circulated list as attending but he was a no-show. Libya's U.N. ambassador spoke for his country.
The U.S. holds the rotating council presidency this month and Obama was the first American president to preside over a Security Council summit, gaveling the meeting into session and announcing that "the draft resolution has been adopted unanimously."
"The historic resolution we just adopted enshrines our shared commitment to a goal of a world without nuclear weapons," Obama said immediately after the vote. "And it brings Security Council agreement on a broad framework for action to reduce nuclear dangers as we work toward that goal."
Just one nuclear weapon set off in a major city - "be it New York or Moscow, Tokyo or Beijing, London or Paris" - could kill hundreds of thousands of people and cause major destruction, Obama said.
The council endorsed a global effort to "lock down all vulnerable nuclear materials within four years" and the president announced that the United States will host an April summit to advance compliance and assist all nations in achieving it.
The resolution does not mention any country by name but it reaffirms previous Security Council resolutions that imposed sanctions on Iran and North Korea for their nuclear activities. It does not call for any new sanctions.
The draft "expresses particular concern at the current major challenges to the nonproliferation regime that the Security Council has acted upon."
"This is not about singling out an individual nation," Obama said. "International law is not an empty promise, and treaties must be enforced."
But Obama, British Prime Minister Gordon Brown and French President Nicolas Sarkozy all identified North Korea, which has tested nuclear weapons, and Iran, suspected of harboring weapon plans, as obstacles to a safer world.
Sarkozy sharply criticized both countries for ignoring Security Council resolutions calling on them to cease such activities.
"We may all be threatened one day by a neighbor, by a neighbor endowing itself" with nuclear weapons, he said.
"What I believe is that if we have the courage to affirm and impose sanctions on those who violate resolutions of the Security Council we will be lending credibility to our commitment to a world with fewer nuclear weapons and ultimately with no nuclear weapons," Sarkozy said.
The British leader called on the council to consider "far tougher sanctions" against Iran.
Obama said the resolution reflects the nuclear agenda he outlined in his April speech in Prague when he declared his commitment to "a world without nuclear weapons."
The president called in that speech for the slashing of U.S. and Russian nuclear arsenals, adoption of the treaty banning all nuclear tests, an international fuel bank to better safeguard nuclear material, and negotiations on a new treaty that "verifiably" ends the production of fissile materials for atomic weapons.
He also strongly backed the Nuclear Nonproliferation Treaty, or NPT, which requires signatory nations not to pursue nuclear weapons in exchange for a commitment by the five nuclear powers to move toward nuclear disarmament. States without nuclear weapons are guaranteed access to peaceful nuclear technology for electricity generation.
All those measures are included in the draft resolution.
In its opening paragraph, the resolution reaffirms the council's commitment "to seek a safer world for all and to create the conditions for a world without nuclear weapons."
Obama warned Thursday against violations of the NPT saying, "We must demonstrate that international law is not an empty promise, and that treaties will be enforced."
But global differences remain.
Russian President Dmitry Medvedev said that "our main shared goal is to untie the problem knots" among nations seeking nuclear nonproliferation and disarmament.
"This is complicated since the level of mistrust among nations remains too high, but it must be done," he said.
Chinese President Hu Jintao focused on a late addition to Thursday's resolution: a call for all nuclear-weapon states to commit to "no first use" of those weapons, and to not using them against non-nuclear states. China has long proclaimed such a policy, which the U.S. has never embraced.
"All nuclear-weapon states should make an unequivocal commitment of unconditionally not using or threatening to use nuclar weapons against non-nuclear-weapon states," Hu said.
U.N. Secretary-General Ban Ki-moon saluted the national leaders for joining in the unprecedented Security Council summit on nuclear arms.
"This is a historic moment, a moment offering a fresh start toward a new future," he said.
Among the invited guests were U.N. nuclear chief Mohamed ElBaradei, former U.S. Secretaries of State Henry Kissinger and George Shultz, former U.S. Defense Secretary William Perry, media mogul Ted Turner, former U.S. Senator Sam Nunn and Queen Noor of Jordan - all campaigners against nuclear weapons.
Nunn, a Georgia Democrat who heads the Nuclear Threat Initiative, a Washington-based group designed to fight the global spread of nuclear materials, said the most important thing about the resolution "is the high-level visibility that will be taking place ... with world leaders gathering to remind both themselves and the world that we are at a nuclear tipping point."
Associated Press Writers John Heilprin and Charles Hanley contributed to this report from the United Nations.