China’s top general said Monday a fourth North Korean nuclear weapons test is a possibility that underscores the need for fresh talks between Pyongyang and other regional parties.

Chief of the General Staff Gen. Fang Fenghui said Beijing firmly opposes the North’s nuclear weapons program and wants to work with others on negotiations to end it. He said Beijing’s preference is for a return to long-stalled disarmament talks involving the two Koreas, China, Russia, Japan and the United States.

“We ask all sides to work actively to work on the North Koreans to stop nuclear tests and stop producing nuclear weapons,” Fang told reporters. “We believe that dialogue should be the right solution.”

Fang offered no indication as to when Beijing thought a test might happen and gave no other details.

His comments followed a meeting with Gen. Martin Dempsey, chairman of the Joint Chiefs of Staff, whose first visit to China in that position comes amid heightened tensions between Pyongyang, South Korea and the U.S.

North Korea has ratcheted up tension on the divided peninsula in recent weeks, threatening to attack the U.S. and South Korea over recent military drills and sanctions imposed as punishment for its third nuclear test in February. Pyongyang calls the annual drills a rehearsal for invasion. South Korean officials have said the North is poised to test-fire a medium-range missile capable of reaching the American territory of Guam.

China is North Korea’s most important diplomatic ally and main trading partner, and provides a key source of food and fuel aid. Yet while Beijing signed on to tougher U.N. sanctions following the February test, it says it has limited influence with Pyongyang, and Fang declined to say whether Beijing would adopt tougher measures to pressure the North into reducing tensions.

In other remarks, Fang also sought to reassure Dempsey over recent reports of Chinese military-sponsored hacking attacks on U.S. targets, saying China opposed all such activity. The new spotlight on a long-festering problem has prompted calls for Washington to get tough on Beijing, and the administration is reportedly considering measures ranging from trade sanctions to diplomatic pressure and electronic countermeasures.

Fang repeated China’s portrayal of itself as a major victim of hacking, saying China is heavily reliant on the Internet and has a strong vested interest in ensuring cybersecurity.

“If control is lost over security in cyberspace, the effects can be, and I don’t exaggerate, at times no less than a nuclear bomb,” Fang said.

For his part, Dempsey sought to allay Chinese unease about the U.S. military’s renewed focus on Asia. That has reawakened Chinese fears of being encircled by U.S. bases and alliances and brought strong criticism from the military.

“One of the things I talked about today with the general, is we seek to be a stabilizing influence in the region. And in fact, we believe, that it would be our absence that would be destabilizing, not our presence,” Dempsey said.

However, while Washington is committed to building a “better, deeper, more enduring” relationship with China, its traditional alliances in Asia — including with Japan and other Chinese rivals — could at times create friction, he said.