The top US military officer said on Wednesday Chinese leaders had assured him that they were working on persuading North Korea to abandon its nuclear weapons program.

China is North Korea’s main diplomatic and financial backer and fought alongside the North in the 1950-53 Korean War. It has always been reluctant to apply pressure on the North, fearing a flood of refugees into China if North Korea were to collapse.

But in recent months, China has begun to express impatience with North Korea and its threats of nuclear war, and with its 30-year-old leader, Kim Jong Un, grandson of state founder Kim Il-Sung.

“I will leave here with the belief that the Chinese leadership is as concerned as we are with North Korea’s march toward nuclearization and ballistic missile technology, and they have given us an assurance that they are working on it, as we are,” US Chairman of the Joint Chiefs of Staff General Martin Dempsey told reporters on the last day of a trip to China.

“So, we think there’s still time for North Korea’s leaders to back away from further provocations and we certainly hope they take the opportunity to do so,” he said.

North Korea stepped up defiance of U.N. Security Council resolutions in December when it launched a rocket that it said had put a scientific satellite in orbit. Critics said the launch was aimed at developing the kind of technology needed to deliver a nuclear warhead mounted on a long-range missile.

That was followed in February by the North’s third test of a nuclear weapon. That triggered new U.N. sanctions in March which in turn led to a dramatic intensification of the North’s threats against South Korea and the United States.

US Secretary of State John Kerry has stressed China’s importance in influencing North Korea and made that point in talks in Beijing this month.

Dempsey said “provocations have been somewhat prolonged” since Kim Jong Un took over as leader of North Korea soon after the late 2011 death of his father, Kim Jong-il.

“What that means is that I think the risk of miscalculation is higher, and I think the risk of escalation is higher,” he said.

The United States was able to defend itself if North Korea launches a nuclear weapon, Dempsey said.

“Our military posture is one of deterrence and preparedness,” he said. “And if they were to launch, we do have the capability to defend ourselves, our people, our facilities, and we’ve been very clear about that.”

After weeks of tension, the North has in recent days begun to at least talk about dialogue in response to calls for talks from both the United States and South Korea.

On Tuesday, North Korea insisted that it be recognized as a nuclear weapons state before talks could begin, a demand the United States dismissed as “neither realistic nor acceptable”.