BEIJING — China’s parliament elected Wang Qishan, a key ally of President Xi Jinping, into the role of vice president on Saturday, a move that breaks with tradition but will bolster the president’s authority.

At the same time, Xi was unanimously endorsed to serve a second five-year term as president, by 2,970 votes to zero.

Last Sunday, the National People’s Congress, China’s rubber-stamp parliament, voted to change the constitution to remove a two-term limit on the presidency and vice-presidency. All the senior officials elected Saturday stood in front of delegates in a chilly Great Hall of the People formally swearing their allegiance to that constitution, as snow fell outside.

At 69, Wang would normally be considered too old for a five-year term as vice president, but Xi clearly felt he needed his trusted lieutenant alongside him as he began his own second term. Wang’s presence will invest the role, seen as largely ceremonial in the past, with new power and authority, experts say.

Wang ran the anti-corruption agency during Xi’s first term, overseeing a far-reaching campaign against graft that had seemingly infested every corner of the government, netting dozens of senior Communist Party and military officials, including several seen as disloyal to the president.

Now, as vice president, Wang is expected to play a role in trying to manage China’s increasingly testy relations with the United States, at a time when President Trump is demanding a big reduction in the trade imbalance between the two countries.

There was long and enthusiastic applause to greet Xi’s election as president and as chairman of the Central Military Commission. The president bowed to parliament, waved and even joined in the applause himself.

Then came Wang’s election, with 2,969 in favor and only one vote against: It wasn’t clear if Wang voted against himself in a show of humility, or if this represented a genuine dissenting voice. He bowed twice, then walked over to Xi to shake his hand.

Then soldiers goose-stepped up to the podium, one carrying a copy of the constitution in white-gloved hands. Xi was first to be sworn in, his left hand on the constitution, his right hand raised in closed-fist salute, as he recited the oath of office.

Wang’s reputation as a firefighter is based on his role in tackling corruption as well as addressing problems stemming from the Asian financial crisis in the 1990s and the 2003 outbreak of SARS (severe acute respiratory syndrome). He later ran the economic track of the U.S.-China Strategic and Economic Dialogue under President Hu Jintao and during the Obama presidency.

Kerry Brown, a professor of China studies at King’s College, London, said Wang was “very necessary for Xi’s type of politics,” where strict loyalty to the president is demanded and enforced.

“He has shown himself to be a very capable politician, and he is still relatively young, so it makes sense for him to stick around,” Brown said.

Mei Xinyu, a researcher at the Chinese Academy of International Trade and Economic Cooperation, said Wang would probably take charge not only of the trade relationship with the United States, but also the broader relationship with Washington.

If Wang does play that role, it would be a very welcome development for many Americans, said Evan Medeiros, who met him several times when serving as senior adviser for Asian affairs in the Obama administration.

“He is the rare senior Chinese official that has major credibility in both Beijing and Washington,” said Medeiros, who now leads the Eurasia Group’s coverage of the Asia-Pacific. “Both American business leaders and policymakers welcome his expertise and frank style of negotiating; he is a trusted interlocutor.”

But Wang would not be inheriting an easy task. Xi’s top diplomat, Yang Jiechi, and his top economic adviser, Liu He, made separate trips to Washington last month in a bid to defuse tensions in the relationship, but failed to ward off a looming storm over trade.

Liu He’s visit was immediately followed by Trump’s announcement of steep tariffs on steel and aluminum imports. This week it emerged that Trump has ordered his chief trade negotiator to develop tougher tariff proposals to punish China for years of stealing U.S. trade secrets, although the U.S. Chamber of Commerce warned this would hurt American consumers.