BEIJING — China and the United States tentatively agreed Thursday to more exchanges between their militaries, helping bring a semblance of stability to often rocky ties between the distrustful defense establishments.

Two days of talks between U.S. Undersecretary of Defense Walter Slocombe and a raft of Chinese generals exhibited the wavering dynamics that now characterize overall relations. China's pledge last week not to help Pakistan, Iran and others build nuclear-capable missiles brightened the atmosphere, Slocombe said.

At the same time, a recent Chinese defense policy paper — discussed in the talks — directly and indirectly singled out the United States and its military alliances in the region as a threat to China.

Slocombe said he told the Chinese such remarks are "unhelpful."

He later told reporters: "There's no question that the United States and China have real differences about issues, and that some of those are quite important differences. There's a difference between that and regarding each other as enemies."

He told the Chinese that U.S. military alliances with Japan, South Korea, Australia and others provide the region with stability for economic growth.

Still Slocombe said his meetings with Gen. Chi Haotian, the defense minister, Gen. Xiong Guangkai, deputy chief of the Chinese military's general staff, and others produced "tangible results."

Both sides mapped out plans, subject to final approval, for more high-level visits between their militaries next year.

"They're very modest and gradual steps. The military-to-military relationship is clearly going to grow, if at all, gradually," Slocombe said.

China also gave a positive but limited review of the talks. Foreign Ministry spokeswoman Zhang Qiyue said "the consultations have increased understanding and trust."

The sober assessments underscored how realistic both governments are about military cooperation after years of fitful ties. Relations opened in the 1980s were stopped after China crushed the Tiananmen Square democracy demonstrations in 1989. They began a slow crawl back three years ago but were scuttled by the U.S. bombing of China's embassy in Yugoslavia in May 1999.

In patching up differences, both sides have tried to focus on areas of agreement and lessen the chances for conflict. In his meetings, Slocombe said they touched on both — discussing ways to support better relations between the Koreas and differences over Taiwan and proposed U.S. anti-missile defenses.

Both sides even compared notes on the different receptions North Korea gave Defense Minister Chi and U.S. Secretary of State Madeleine Albright, on separate but overlapping visits last month, Slocombe said. He declined to elaborate.