China's People's Liberation Army (PLA) has always defended the party as much as national borders.
During the early years of communist rule, most of the country's leaders owed their positions to their military success during the civil war, and links between them and the PLA remained very close.
But as this generation has died off and reforms have been introduced to make the armed forces more professional, the relationship has shifted subtly.
Party leaders know they are lost without the army's support, as became clear during crises like the 1989 Tiananmen protests.
At the same time, senior military leaders realise they need the leadership's backing if far-reaching plans to modernise the armed forces are to be paid for.
The party's control over the armed forces and their nuclear arsenal is institutionalised through the Central Military Affairs Commission.
The 11-man commission has the final say on all decisions relating to the PLA, including senior appointments, troop deployments and arms spending.
Almost all the members are senior generals, but the most important posts have always been held by the party's most senior leaders.
The commission also controls the paramilitary People's Armed Police, who have the politically sensitive role of guarding key government buildings, including the main leadership compound of Zhongnanhai in Beijing.
In theory, the commission's chairman is elected by the National People's Congress. But in practice, the job automatically goes to the party's most powerful figure, who effectively becomes commander-in-chief.
The chairmanship was held by Mao Zedong and then Deng Xiaoping, who stayed in the job after he had resigned from all other positions, suggesting to some analysts that this is the real source of power in China.
Jiang Zemin, who became Chairman in 1989, had none of the military background or cachet of his predecessors. But by careful promotions of supporters and budget increases, Jiang ensured strong support from the military and within the Commission.
He resigned in 2004, handing the chairmanship to a man with even weaker military links, Hu Jintao, who has since tried to build his own power base in the military.