North Korea agreed today to what amounts to a freeze in its missile testing program, clearing the way for improved relations with the United States and its key Asian allies, Western officials said.

Senior U.S. and North Korean delegations, headed by U.S. special envoy Charles Kartman and Deputy Foreign Minister Kim Gye Gwan of North Korea, announced after five days of discussions in Berlin that their countries have pledged "to preserve a positive atmosphere conducive to improved bilateral relations and to peace and security in Northeast Asia and the Asia-Pacific region."

Although North Korean officials said nothing publicly to interpret the pledge, Western diplomats familiar with the talks said that, while it fell short of a treaty-level commitment, North Korea acknowledged that any further missile tests would run counter to its promise not to do anything to damage relations with the United States.

As a result, they said, the accord seemed to go a long way toward easing tensions created by Pyongyang's plans to test the Taepodong II, an advanced and longer-range model of a missile that caused alarms across the region when it was test-fired over Japan a year ago.

"There has been a strong concern about an imminent test," said a senior U.S. official. "I think it is safe to say that we do not have that concern any longer."

In exchange, the United States agreed to encourage the process of developing normal relations and eventually removing the array of decades-old sanctions that have banned all commercial and other exchanges with North Korea except for humanitarian food aid.

For the past three years, the United States has been trying to persuade the reclusive Stalinist state to abandon its missile testing program to defuse growing security concerns in the North Asian region and to bolster prospects for better relations with Washington as well as Japan and South Korea.

North Korea upset its neighbors Aug. 31, 1998, by test-firing the three-stage Taepodong I missile, part of which flew over Japan. The North Korean government said the missile was to lift satellites into space, but regional defense experts expressed fear it could also carry warheads. After that, intelligence reports warned that Pyongyang was preparing to launch another test, this one involving the longer-range Taepodong II, with the ability to reach Alaska or Hawaii.

North Korea's missile testing program is viewed as a serious threat to the military balance in East Asia. After last year's launch, Japan and Taiwan have pressed the United States to help them install antimissile defense systems, while South Korea has sought Washington's approval to upgrade its own missile capabilities.

A new arms race that would provide Taiwan with missile defenses would undoubtedly trigger a fierce reaction from China, which regards Taiwan as a renegade province. Facing the risk of escalating these security tensions, the United States has placed a high priority on convincing North Korea to end its testing program.

While Pyongyang has refused to accept formal constraints on what it considers its sovereign right to test missiles, it has signaled a willingness to scrap the program if the United States would expand its aid program and cancel economic sanctions.

Former U.S. defense secretary William J. Perry, who has been in charge of coordinating Washington's dealings with North Korea, visited Pyongyang last May. U.S. officials said Perry came away impressed by the government's apparent readiness to find a compromise that would link concerns about the missile program with its goal of enhanced ties with Washington.

After Perry's promising encounters in Pyongyang, Kartman and Kim held follow-up discussions a month later in Beijing and pursued further negotiations in Geneva in early August. In announcing the successful conclusion of the current round, the two delegations said they had arrived at "a deeper understanding of the other's concerns and each acknowledged the need to continue taking steps that address these concerns."

North Korea has been largely dependent on outside assistance to feed its people since reports of widespread famine began circulating in 1995, when the agriculture system collapsed after decades of mismanagement and a prolonged period of bad weather. But U.S. officials said that during the past week's negotiations, the North Koreans never raised the question of securing more food aid as the price for freezing their missile tests. In recent months, international relief agencies have reported a considerable improvement in North Korea's food supplies and the health of its population.

However, the officials said North Korea continued to press its demands for a complete lifting of economic sanctions and the abolition of its status as a pariah state that supports international terrorism and maintains belligerent intentions against its neighbors.

"They have some strong expectations but so do we," said a senior Clinton administration official. "The fact that these talks went more smoothly than ever before offers hope for a further reduction in tensions and some real movement toward a better relationship in the future."