Chinese President Xi Jinping warned self-ruled Taiwan on Tuesday that it will face the "punishment of history" for any attempt at separatism, offering his strongest warning yet to the island claimed by China as its sacred territory.

Taiwan is one of China's most sensitive issues and a potentially dangerous military flashpoint.

China's hostility towards Taiwan has risen since the 2016 election of President Tsai Ing-wen from the pro-independence Democratic Progressive Party.

China suspects Ms Tsai wants to push for formal independence, which would cross a red line for Communist Party leaders in Beijing, though Ms Tsai has said she wants to maintain the status quo and is committed to ensuring peace.

China has been infuriated by US President Donald Trump's signing into law legislation last week that encourages the United States to send senior officials to Taiwan to meet Taiwanese counterparts and vice versa.

AAP

The United States does not have formal ties with Taiwan but is required by law to help it with self-defence and is the island's primary source of weapons.

In a speech at the end of China's annual session of parliament, Mr Xi told the 3,000-odd delegates that China would push for the "peaceful reunification of the motherland" and work for more Taiwanese to enjoy the opportunities of China's development.

"It is a shared aspiration of all Chinese people and in their basic interests to safeguard China's sovereignty and territorial integrity and realise China's complete reunification," Mr Xi said.

Related reading

"Any actions and tricks to split China are doomed to failure and will meet with the people's condemnation and the punishment of history," he added, to loud applause.

China has the will, confidence and ability to defeat any separatist activities, Xi said.

But Mr Xi also sought to address concerns about ambitious Chinese development projects abroad, saying they "will not pose a threat to any country."

"Only those who are accustomed to threatening others will see everyone as a threat," he added.

China is overseeing a massive global trade infrastructure initiative to revive the ancient Silk Road, drawing interest from nations participating in the investment but also criticism from others fearing that it mainly serves Beijing's interests.

The Chinese leader's plan to build a "world-class" military by mid-century has also raised concerns about how it plans to use its increasingly modern forces amid regional frictions over China's territorial claims in the South China Sea.

Mr Xi used the speech to espouse his vision of realising the "rejuvenation of the Chinese nation" - the "greatest dream" of the world's second-largest economy.

"The Chinese people have been indomitable and persistent, we have the spirit of fighting the bloody battle against our enemies to the bitter end," he said.

His speech was also a reminder that the Communist Party, more than ever, reigns over the country's affairs.

"History has already proven and will continue to prove that only socialism can save China," he said.

"The Communist Party is the supreme political leadership of the country and the fundamental guarantee to achieve the great rejuvenation of the Chinese nation."

Indefinite rule

The two-week session of the National People's Congress handed Mr Xi, 64, a second term and endorsed the Communist Party's decision to lift presidential term limits, clearing the way for him to remain in power indefinitely after his new term ends in 2023.

His eponymous political philosophy, which was enshrined in the party charter last year, was added to the national constitution and senior government officials had to swear an oath to the document for the first time.

Some of Mr Xi's key lieutenants were also promoted to top positions. His former anti-corruption czar, Wang Qishan, was elevated to the vice presidency while his top economic adviser, Liu He, became vice premier.

Mr Wang could use his experience as a trade negotiator to deal with rocky relations with the Trump administration, while Mr Liu is expected to have an influential role in economic policymaking.

Mr Trump is considering new punitive measures against China over its "theft" of US intellectual property, raising fears of a tit-for-tat trade war.

More news South Korea, US military drills to resume despite thaw with North

"We hope that both parties can maintain reason, not act emotionally, and avoid a trade war," Premier Li Keqiang told a press conference after Xi's speech.

On the domestic front, the legislature approved the biggest government shake-up in years, merging the banking and insurance regulators to tackle financial risks, and amended the constitution to expand the Communist Party's role in the country's affairs.

Mr Xi's campaign against corruption within the Communist Party, which punished 1.5 million officials in five years, was expanded as the legislature voted Tuesday to create a national agency that will scrutinise millions of public servants.

"The Communist Party of China must... resolutely eliminate" corruption, Mr Xi said.

The government's propaganda machine worked in overdrive to nurture a cult of personality around Xi and stamp out dissenting views during the two-week session.

The People's Daily, the Communist Party mouthpiece, referred to Mr Xi as the "helmsman" last weekend, an echo of Mao who was known as "the great helmsman".

The abolition of term limits triggered a rare bout of criticism on social media, prompting censors to block dozens of phrases such as "I disagree" or "emperor" as well as satirical images such as Winnie the Pooh - the cartoon bear that some compare to Mr Xi.

China has stepped up its crackdown on civil society since Mr Xi took power in 2012, tightening online restrictions and detaining hundreds of activists and lawyers.

Additional reporting: AFP