China has signalled its readiness to accept Korean reunification and is privately distancing itself from the North Korean regime, according to leaked US embassy cables that reveal senior Beijing figures regard their official ally as a "spoiled child".

News of the Chinese shift comes at a crucial juncture after the North's artillery bombardment of a South Korean island last week that killed four people and led both sides to threaten war. China has refused to condemn the North Korean action. But today Beijing appeared to bow to US pressure to help bring about a diplomatic solution, calling for "emergency consultations" and inviting a senior North Korean official to Beijing.

China is sharply critical of US pressure tactics towards North Korea and wants a resumption of the six-party nuclear disarmament talks. But the Guardian can reveal Beijing's frustration with Pyongyang has grown since its missile and nuclear tests last year, worries about the economic impact of regional instability, and fears that the death of the dictator, Kim Jong-il, could spark a succession struggle.

China's moves to distance itself from Kim are revealed in the latest tranche of leaked US embassy cables published by the Guardian and four international newspapers. Tonight, the US secretary of state, Hillary Clinton, said the US "deeply regrets" the release of the material by WikiLeaks. They were an "attack on the international community", she said. "It puts people's lives in danger, threatens our national security and undermines efforts to work with other countries to solve shared problems," she told reporters at the state department.

The leaked North Korea dispatches detail how:

• South Korea's vice-foreign minister said he was told by two named senior Chinese officials that they believed Korea should be reunified under Seoul's control, and that this view was gaining ground with the leadership in Beijing.

• China's vice-foreign minister told US officials that Pyongyang was behaving like a "spoiled child" to get Washington's attention in April 2009 by carrying out missile tests.

• A Chinese ambassador warned that North Korean nuclear activity was "a threat to the whole world's security".

• Chinese officials assessed that it could cope with an influx of 300,000 North Koreans in the event of serious instability, according to a representative of an international agency, but might need to use the military to seal the border.

In highly sensitive discussions in February this year, the-then South Korean vice-foreign minister, Chun Yung-woo, told a US ambassador, Kathleen Stephens, that younger generation Chinese Communist party leaders no longer regarded North Korea as a useful or reliable ally and would not risk renewed armed conflict on the peninsula, according to a secret cable to Washington.

Chun, who has since been appointed national security adviser to South Korea's president, said North Korea had already collapsed economically.

Political collapse would ensue once Kim Jong-il died, despite the dictator's efforts to obtain Chinese help and to secure the succession for his son, Kim Jong-un.

"Citing private conversations during previous sessions of the six-party talks , Chun claimed [the two high-level officials] believed Korea should be unified under ROK [South Korea] control," Stephens reported.

"The two officials, Chun said, were ready to 'face the new reality' that the DPRK [North Korea] now had little value to China as a buffer state – a view that, since North Korea's first nuclear test in 2006, had reportedly gained traction among senior PRC [People's Republic of China] leaders. Chun argued that in the event of a North Korean collapse, China would clearly 'not welcome' any US military presence north of the DMZ [demilitarised zone]. Again citing his conversations with [the officials], Chun said the PRC would be comfortable with a reunified Korea controlled by Seoul and anchored to the US in a 'benign alliance' – as long as Korea was not hostile towards China. Tremendous trade and labour-export opportunities for Chinese companies, Chun said, would also help 'salve' PRC concerns about … a reunified Korea.

"Chun dismissed the prospect of a possible PRC military intervention in the event of a DPRK collapse, noting that China's strategic economic interests now lie with the United States, Japan and South Korea – not North Korea."

Chun told Stephens China was unable to persuade Pyongyang to change its self-defeating policies – Beijing had "much less influence than most people believe" – and lacked the will to enforce its views.

A senior Chinese official, speaking off the record, also said China's influence with the North was frequently overestimated. But Chinese public opinion was increasingly critical of the North's behaviour, the official said, and that was reflected in changed government thinking.

Previously hidden tensions between Pyongyang and its only ally were also exposed by China's then vice-foreign minister in a meeting in April 2009 with a US embassy official after North Korea blasted a three-stage rocket over Japan into the Pacific. Pyongyang said its purpose was to send a satellite into orbit but the US, South Korea and Japan saw the launch as a test of long-range missile technology.

Discussing how to tackle the issue with the charge d'affaires at the Beijing embassy, He Yafei observed that "North Korea wanted to engage directly with the United States and was therefore acting like a 'spoiled child' in order to get the attention of the 'adult'. China encouraged the United States, 'after some time', to start to re-engage the DPRK," according to the diplomatic cable sent to Washington.

A second dispatch from September last year described He downplaying the Chinese premier's trip to Pyongyang, telling the US deputy secretary of state, James Steinberg: "We may not like them ... [but] they [the DPRK] are a neighbour."

He said the premier, Wen Jiabao, would push for denuclearisation and a return to the six-party talks. The official also complained that North Korea "often tried to play China off [against] the United States, refusing to convey information about US-DPRK bilateral conversations".

Further evidence of China's increasing dismay with Pyongyang comes in a cable in June 2009 from the US ambassador to Kazakhstan, Richard Hoagland. He reported that his Chinese counterpart, Cheng Guoping. was "genuinely concerned by North Korea's recent nuclear missile tests. 'We need to solve this problem. It is very troublesome,' he said, calling Korea's nuclear activity a 'threat to the whole world's security'."

Cheng said Beijing "hopes for peaceful reunification in the long term, but he expects the two countries to remain separate in the short term", Hoagland reported. China's objectives were "to ensure they [North Korean leaders] honour their commitments on non-proliferation, maintain stability, and 'don't drive [Kim Jong-il] mad'."

While some Chinese officials are reported to have dismissed suggestions that North Korea would implode after Kim's death, another cable offers evidence that Beijing has considered the risk of instability.

It quoted a representative from an international agency saying Chinese officials believed they could absorb 300,000 North Koreans without outside help. If they arrived "all at once" it might use the military to seal the border, create a holding area and meet humanitarian needs. It might also ask other countries for help.

The context of the discussions was not made explicit, although an influx of that scale would only be likely in the event of regime failure. The representative said he was not aware of any contingency planning to deal with large numbers of refugees.

A Seoul embassy cable from January 2009 said China's leader, Hu Jintao, deliberately ducked the issue when the South Korean president, Lee Myung-bak, raised it at a summit.

"We understand Lee asked Hu what China thought about the North Korean domestic political situation and whether Beijing had any contingency plans. This time, Hu apparently pretended not to hear Lee," it said. The cable does not indicate the source of the reports, although elsewhere it talks about contacts at the presidential "blue house" in South Korea.