Mr. Xi has accompanied the demands for unity with a vivid warning to officials who step out of line. In the past week, he oversaw the abrupt purge of Sun Zhengcai, a onetime contender for promotion at the congress. Mr. Sun, 53, had been the party secretary of Chongqing, a city in southwest China, until his dismissal in mid-July.

The party announced last Monday that he was under investigation for violations of “discipline” — usually a euphemism for corruption — and Mr. Sun has since been pilloried in official media. Provincial leaders, including many with a shot at promotion, have called meetings to denounce Mr. Sun as a “tiger,” or corrupt senior official.

“At this point, we can’t say for sure he will be the last big tiger to be brought down before the opening of the party congress,” said Prof. Ding Xueliang, a political scientist at the Hong Kong University of Science and Technology who studies the Chinese Communist Party. “We don’t know; other leaders don’t know either.”

For now, Mr. Xi appears to be seeking to ensure that his second-term lineup includes younger loyalists who will defend him and his policies for years to come. Several are poised to join the Politburo, a council of 25 senior central, provincial and military leaders. Up to 11 members of the Politburo are likely to retire at the congress, including five members of the Politburo Standing Committee, a more powerful body with seven members.

The negotiations over the new lineup happen in secret. But the burst of propaganda and warnings appears intended to pressure officials and retired leaders to go along with Mr. Xi’s wishes over who goes up and who steps down.

Mr. Xi is by the estimate of many observers China’s most powerful leader since Deng Xiaoping, who died in 1997. While the military does not have much direct say in politics, its support is essential for Mr. Xi’s long-term authority, Professor Ding said.

“Xi Jinping has spent more time on the military than any other leader,” Professor Ding said by telephone. “He knows clearly that eventually, if he wants to keep in power, if he wants to concentrate power even more, he must make sure the army is with him.”