Coming down hard on supporters for formal independence for Hong Kong and Taiwan, he asserted that "not a single inch of the land" would be separated from China. "China is resolute in upholding its own territorial integrity and will not abandon an inch of its own land".
"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.
Xi is set to shape China for the coming decades after the historic legislative session that abolished presidential term limits to allow him to rule for as long as he wants.
The parliament on Tuesday also passed a law to regulate a new, powerful anti-graft agency that will extend Xi's sweeping anti-corruption campaign from Communist Party members to all civil servants.
Instead, Xi insisted that China did not seek "hegemony or expansionism" and made a remark some have interpreted as a barb against the Trump administration, which has branded the renegade Xi regime a threat.
In his address, Xi said China would promote "high-quality" development that values innovation over the speed of growth.
Modi, in his message posted on his account on the Chinese social media platform Weibo on Monday, had said: "Dear President Xi Jinping, congratulations on getting re-elected as the President of the People's Republic of China".
The two-term limit on the presidency was introduced by former Chinese President Deng Xiaoping in 1982.
In a way it wasn't so much what Xi Jinping said in his Congress closing speech that matters but the fact that he said it.
He added: "Now that he's made himself emperor-for-life, he might be feeling impregnable on the foreign policy front, and this is very risky".
"Only those who are accustomed to threatening others will see everyone as a threat", he said.
"In some areas, the global community may hope China will assume a greater role", Li said.
Xi also promised "rejuvenation" and warned against attempts to erode China's unity during his speech.
Other key developments: The Congress also saw a number of Xi's most loyal allies promoted to top positions.
"This is against the tide of civilisation and won't stand the test of time", he told BBC Chinese.
Another is longtime Xi adviser Liu He, who was appointed as one of four vice premiers and is expected to oversee a broad range of economic and financial issues.