BEIJING -- North Korea pledged today to end its nuclear weapons program and rejoin global treaties aimed at stemming the spread of atomic arms in return for energy aid and diplomatic recognition.

During a news conference at the White House today, President Bush called the agreement "a positive step."

"It was a step forward in making this world a more secure place," Bush said. He added, "The question is, over time, will all parties adhere to the agreement?"

According to a joint statement by the six nations involved in negotiations for more than two years, Pyongyang "committed to abandon all nuclear weapons and existing nuclear programs and to return at an early date to the nonproliferation treaty of nuclear weapons." It also said North Korea would accept International Atomic Energy Agency safeguards.

In other matters, the United States and North Korea agreed to respect each other's sovereignty, a key Pyongyang demand, and to take steps to normalize diplomatic relations.

In return for Pyongyang's accord, the other nations agreed that North Korea had the right to the peaceful use of nuclear energy and said they would discuss providing it a light-water reactor in the future.

Pyongyang's demand for a civilian nuclear energy program has been a major stumbling block in this seven-day round of talks. The United States remains fearful that North Korea might divert spent nuclear fuel to weapons -- a step the communist nation is believed to have taken in the past.

Washington affirmed that it had no nuclear weapons on the Korean peninsula and no intention of attacking North Korea, which the Bush administration has in the past characterized as a member of an "axis of evil" and as an "outpost of tyranny."

The announcement marked the first time in the lengthy negotiations that any agreement had been announced. Details are still to be worked out, and the parties agreed to hold another round of talks in Beijing in November.

"This is real progress, and a big achievement," said Zhang Liangui, a North Korea expert at the Central Party School in Beijing. "It's a milestone."

That said, as always with North Korean negotiations, a lot will depend on the details and implementation, a concern Liangui acknowledged.

"It's crucial that the wording won't leave much room for different parties to read different things into it," he said.

On the issue of the reactor, the United States had argued that Pyongyang did not need a civilian light-water reactor, given an offer by South Korea to transmit electricity across its border with the North.

North Korea had also refused to budge. It appeared that the six parties involved -- China, Japan, the two Koreas, Russia and the United States -- finessed this issue by agreeing that North Korea has the right to a peaceful nuclear energy program, as long as it does not exercise that right before safeguards are in place.

At that point, the parties could discuss the light-water reactor.

The United States also affirmed in the statement that it has no nuclear weapons on the Korean peninsula and no intention of attacking or invading North Korea.

All six nations agreed to promote cooperation in the fields of energy, trade and investment.

The fourth round of talks followed what has become a familiar pattern in tortuous negotiations with North Korea, with a breakthrough coming just as it seemed the negotiators were about to throw up their hands and walk away. Earlier in the day, Assistant Secretary of State Christopher Hill, the chief U.S. negotiator, described the talks as at an "endgame," and the parties as ready to go home.

The key sticking point had been what type of civilian nuclear program North Korea would be allowed to keep after dismantling its weapon-making facilities. The United States readily acceded to Pyongyang's demands to use a small research reactor to produce radioactive isotopes for medicine and agriculture, but vetoed the idea of a light-water reactor -- a type less easily adapted to weapons production -- for electricity.