Mr Xi made the remarks at a "national meeting" on Friday also attended by Premier Li Keqiang and Vice Premier Zhang Gaoli, the official Xinhua news agency said.
In his remarks on the defence of China's borders, Mr Xi said the country's weakness in the past had allowed others to bully it.
"Foreign aggressors broke China's land and sea defence for hundreds of times, plunging the Chinese nation into the abysm of calamity, Mr Xi added, calling on the people not to forget the history of humiliation and to build a strong frontier," the report said.
"Xi urged China's frontier defenders to meticulously monitor over and control the frontier and to mount actions to defend the country's maritime right, while implementing an overall national security outlook."
The nationalistic-tinged comments reported by Xinhua are Mr Xi's latest calling for a tougher military stance.
Since becoming China's leader during a once-a-decade power transition that lasted from November 2012 until March 2013, Mr Xi has called for the country to boost its military into a force that can "win battles".
Other officials, such as Foreign Minister Wang Yi, also stress that China will fiercely defend territory it considers its own, but insist the country poses no threat to others.
Mr Xi's reference to frontiers comes as China is engaged in occasionally tense maritime disputes over territory with Japan, the Philippines and Vietnam.
On land, China has a long-standing dispute with India. And Beijing has also blamed what it calls foreign-based "religious extremists" for fomenting terrorism in its largely Muslim far-western region of Xinjiang, which borders Central Asia.
China's Communist Party leaders have for decades stressed that under their leadership that began in 1949 the country finally overcame more than a century of humiliation by outside powers dating back to the Opium Wars of the 19th century.
Under the last imperial Qing Dynasty, China also saw incursions by western powers and Japan that secured trade and legal concessions as well as control of territory seen in China as unfair.
References to national humiliations, such as the pillaging of the Old Summer Palace by a joint British and French military expedition during the second Opium War in 1860 and the suppression of the Boxer Rebellion in 1900 by a multinational force of Europeans, Americans and Japanese, are common examples.
The Xinhua report also said, however, that Mr Xi urged "both the military and civilian communities to strike a balance between frontier defence and economic development".
China's leaders, while stressing their nationalistic credentials, are keenly aware that their support also depends on how successfully they steer the world's second-largest economy.