BEIJING – Long-anointed successor Xi Jinping assumes the leadership of China at a time when the ruling Communist Party is confronting slower economic growth, a public clamor to end corruption and demands for change that threaten its hold on power.

The country’s political elite named Xi to the top party post Thursday, and unexpectedly put him in charge of the military too, after a weeklong party congress and months of divisive bargaining.

After decades of juggernaut growth, China sits on the cusp of global pre-eminence as the second largest economy and newest power, but it also has urgent domestic troubles that could frustrate its rise.

Problems that have long festered — from the sputtering economy to friction with the United States and territorial spats with Japan and other neighbors — have worsened in recent months as the leadership focused on the power transfer. Impatience has grown among entrepreneurs, others in the new middle class and migrant workers — all wired by social media and conditioned by two decades of rising living standards to expect better government, if not democracy.

All along, police have continued to harass and jail a lengthening list of political foes, dissidents, civil rights lawyers and labor activists. A 14-year-old Tibetan set himself on fire in western China on Thursday, in the latest of more than 70 self-immolations Tibetans have staged over the past 20 months in desperate protests against Chinese rule.