The price of Beijing’s support for a dynastic succession in North Korea was always meant to be that the young Kim Jong Un would start to follow a course of economic opening similar to the one China embarked on 30 years ago. That was seen in Beijing as the way to avoid regime collapse sending millions of North Korean refugees flooding into China, and to give Beijing first digs on the minerals of resource rich if dirt poor North Korea.

Such a change was always going to mean a stepping back from the late Kim Jong Il’s policy of putting the military first, the basis of his dictatorship, and reassertion of the primacy of the Workers’ Party over the army. The sudden ousting of Ri Yong Ho as chief of general staff and the most senior political figure in the military following a Workers’ Party meeting convened on Sunday suggests that process is underway.

What is impossible to tell is whether that is Kim Jong Un keeping up his end of the bargain with Beijing, or whether he is ruthlessly tightening his grip on power, just as his father did before him after succeeding his own father, Kim Il Sung. China’s state media reported Ri’s downfall in a terse, neutral tone, suggesting they had no more advanced warning than the rest of the world. Yet the suddenness of the onset of Ri’s purported illness indicates that what ails him is a power struggle in Pyongyang. At 69 Ri is young enough by the standards of North Korea’s ruling elite (with one obvious exception) to remain otherwise in rude good health. But although he was influential in smoothing the dynastic transition from the late Kim Jong Il and acted as a mentor to Kim Jong Un, he has not retained the younger Kim’s confidence. In particular, he is said to have resisted the new leader’s orders to deploy soldiers for economic infrastructure projects, an issue that had become symbolic for the army of the forced retreat from its primacy. (Massive state infrastructure development is straight out of China’s economic development playbook.)

Ri’s position was undermined earlier this year when Kim Jong Un put his own man, Choe Ryong Hae, a former Workers’ Party official with no military background, into the army as a vice-marshall and political overseer. There have been persistent reports of lower level purging of army officers, including some executions of those deemed not to have shown sufficiently loyalty to the new leader. Pyongyang has hitherto maintained its facade of unity. With Ri’s dismissal the first cracks are starting to show publicly. If the political turbulence beneath becomes too extreme, that will cause concern in Beijing, which is already growing impatient with its neighbour, and starting to worry that Kim Jong Un wants to be his own man, not its.

Update: The official KCNA news agency says Hyon Yong Chol has been promoted to vice-marshal. It is not clear if the relatively unknown former general becomes army chief in Ri’s place. Update to the update: State media are now referring to Hyon as the army’s chief of staff.

Further update: Kim Jong Un has been promoted to marshal and thus becomes supreme commander of the army. How at leaves the relationship between the military and the Party remains to be seen, but Kim clearly sits atop both at the apex of power.