By Sue-Lin Wong

BEIJING (Reuters) - China will never allow any part of its territory to break off, President Xi Jinping said on Friday, within a week of reining in Hong Kong independence moves and ignoring Taiwan's urging to heed democratic aspirations in the Asian financial hub.

Xi made the comments at an event in Beijing's Great Hall of the People to mark 150 years since the birth of Sun Yat-Sen, China's latest bid to exploit the legacy of a man many view as the founder of the modern nation.

"We will never allow any person, any group, any political party, at any time, in any way, to split from China any part of its territory," said Xi, who is also general secretary of the ruling Communist Party.

"To uphold our national sovereignty and territorial integrity, to never let our country split again and to never let history repeat itself - these are our solemn promises to our people and to our history."

China's parliament on Monday passed a ruling effectively barring two elected Hong Kong pro-independence politicians from taking office, Beijing's most direct intervention in the territory's affairs since the 1997 handover.

Recalling Sun Yat-Sen's belief in a united nation, Xi urged people in China and Taiwan, as well as ethnic Chinese around the world, to oppose independence for Taiwan.

"Any Taiwanese political party, organization or individual – regardless of what they have advocated for in the past – as long as they recognize the "1992 consensus," as long as they recognize the mainland and Taiwan are one China, we are willing to associate with them," Xi added.

The "1992 consensus", agreed with Taiwan's previous China-friendly Nationalist government, acknowledges Taiwan and China are part of a single China, but allows both sides to interpret who is the ruler.

Beijing has halted official communication with self-ruled Taiwan because the government of President Tsai Ing-wen, the leader of the independence-leaning Democratic Progressive Party (DPP), refuses to acknowledge this "one China" principle.

In the Chinese capital this month, Xi met Hung Hsiu-chu, the chief of Taiwan's opposition Nationalists, who has said the party holds out the possibility of a peace pact with China.

(This story has been refiled to correct translation of quote in third paragraph)

(Reporting by Sue-Lin Wong; Additional reporting by J.R. Wu in Taipei; Editing by Clarence Fernandez)