Chairman of the Joint Chiefs of Staff Gen. Dunford testifies before the Senate Armed Services Committee on Capitol Hill. Thomson Reuters BEIJING (Reuters) - There are many difficult issues between the United States and China but both share a commitment to work through them, the United States' top general said on Tuesday during a visit to Beijing amid tension over nuclear-armed North Korea.

"I think we have to be honest. We have many, many difficult issues where we don't necessarily share the same perspective," Joseph Dunford, chairman of the U.S. Joint Chiefs of Staff, told Fang Fenghui, chief of the Joint Staff Department of the People's Liberation Army.

"We share a commitment to work through these difficult issues," he added, without elaborating.

Fang said China attached great important to his visit and had arranged for him to observe a military exercise.

In a later statement, China's Defence Ministry said the two discussed North Korea, Taiwan and the South China Sea and signed a framework agreement on a China-U.S. military dialogue mechanism, though it gave no details.

Fang said cooperation was the only correct choice for the two countries, and their two militaries could certainly become good cooperative partners, the ministry added.

"The Chinese military is willing to make efforts with the U.S. side to strengthen strategic communication, increase strategic mutual trust, deepen practical cooperation, appropriately handle problems and disputes and effectively manage and control risks," the ministry cited Fang as saying.

The United States has called on China to do more to rein in its isolated neighbor North Korea, while China has said it is Washington that needs to be making more efforts to lessen tensions and speak directly to Pyongyang.

Chinese President Xi Jinping speaks during a meeting with five United States governors to discuss clean technology and economic development September 22, 2015 in Seattle. Matt Mills McKnight-Pool/Getty Images

North Korea's leader has delayed a decision on firing missiles towards the U.S. Pacific territory of Guam while he watches U.S. actions a little longer, the North's state media said on Tuesday, as South Korea's president said Seoul would seek to prevent war by all means.

China and the United States, the world's two largest economies, say they are committed to having a stable military-to-military relationship, but there are deep fault lines.

China has been angered by U.S. freedom of navigation patrols near Chinese-controlled islands in the disputed South China Sea and U.S. arms sales and support for self-ruled Taiwan, which China claims as a wayward province.

The United States has expressed concern about what it calls unsafe intercepts of U.S. aircraft by the Chinese air force and a lack of transparency in China's military spending, China being in the midst of an ambitious military modernization program.

(Reporting by Michael Martina; Writing by Ben Blanchard; Editing by Nick Macfie, Robert Birsel)