BEIJING — Chinese President Xi Jinping spoke Thursday about China’s firm resolve to stand up to foreign pressure while laying out national aspirations at the celebration of the 100th anniversary of China’s ruling Communist Party.

China will not accept “sanctimonious preaching from those who feel they have the right to lecture us,” Xi said, according to an official translation of his Mandarin-language remarks. He did not name a specific country, amid growing tensions with the U.S.

Xi said China would never allow any foreign force to bully it, and anyone attempting to do so would “find themselves on a collision course with a great wall of steel forged by over 1.4 billion people.”

“A century ago China was declining and withering away in the eyes of the world,” he said. “Today, the image it presents to the world is one of a thriving nation, that is advancing with unstoppable momentum toward rejuvenation.”

Looking ahead, Xi talked of cooperating with “peace-loving countries,” building up the party and working for “national rejuvenation.” He also spoke generally of “strategic steps” toward the “second centenary goal.”

China’s two centenary goals are to “build a moderately prosperous society in all respects” by 2021 and “build a modern socialist country that is prosperous, strong, democratic, culturally advanced and harmonious” by 2049, the 100th anniversary of the People’s Republic of China.

Xi added that China needed to “promote high quality development” and build up national strength in science and technology.

He emphasized China’s need to modernize its military and train personnel to the level of “world-class standards” in order to ensure national security.

Xi’s speech lasted just over an hour, focusing mostly on a historical narrative of the successful role of the Communist Party in the country’s history since the 19th century. He did not mention controversial events such as the Cultural Revolution.

The length of Xi’s speech contrasted with his brief remarks — less than 10 minutes — at the 70th anniversary of the People’s Republic of China in 2019. The celebration at that time featured extravagant floats from different parts of the country and a military parade, which authorities said earlier would not be the case at the party’s centenary.

On Thursday, Xi wore a traditional grey “Mao” suit, while nearly all leaders and dignitaries who joined him at the gate of the Forbidden City overlooking Tiananmen Square wore western suits and ties. State media said more than 70,000 people attended the celebration.

Most attendees did not appear to wear face masks or practice social distancing at the event, which had strict requirements such as vaccination for attending.

“The party and the Chinese people will keep moving confidently forward in broad strides along the path that we have chosen for ourselves,” Xi said. “We will make sure the destiny of China’s development and progress remains firmly in our own hands.”

“We must uphold the firm leadership of the party. China’s success hinges on the party,” Xi said, adding that “the party was chosen by history and the people.”

On the special administrative region of Hong Kong, Xi said China would “ensure social stability.” He spoke again of advancing toward “peaceful national reunification” with Taiwan, which Beijing considers a breakaway province.

Xi officially became president in 2013 and also holds the highest political position of general secretary of the party’s central committee. He abolished term limits in 2018, effectively allowing him to remain president for life.

As of June 5, state media said there were 95.148 million members of the Chinese Communist Party, up 3.234 million from the end of 2019. More than 12 million, or about 13%, were age 30 and younger.

Becoming a member of the party is encouraged from an early age, although the process of joining is highly selective. Many senior positions, even in private businesses, often require party membership.

The official narrative recognizes July 1, 1921, as when the party was founded, although the exact date may have been slightly different. The gathering of delegates, including future leader Mao Zedong, came almost 30 years before the Chinese Communist Party fought Japan, then the Chinese Nationalist (Kuomintang) party, to become the ruling party of the People’s Republic of China.