Wen Tianxiang 文天祥 (1236-1283), courtesy name Lüshan 履善 or Songduan 宋瑞, style Wenshan Xiansheng 文山先生, was a writer and "nationalist" philosopher of the late Southern Song period 南宋 (1127-1279). Chinese historians often hail him as an ardent patriot in the face of the Mongol invasion. He hailed from Jizhou 吉州 (modern Ji'an 吉安, Jiangxi) and obtained the jinshi degree in 1256. He was several times dismissed from office because of his open critique towards powerful ministers. He was pacification commissioner (anfushi 安撫使) of Jiangxi. When the Mongols threatened the continuance of the dynasty he was offered the post of counsellor, but Wen Tianxiang refused and withdrew to Fujian. Only when Emperor Duanzong 宋端宗 (r. 1276-1277) was enthroned in the region of Fujian, he accepted the seal of Counsellor to the Right (you chengxiang 右丞相) and was given the title of Duke of Xin 信國公.
Commanding the troops of resistance against the Mongol invaders, he was captured but refused to serve the Mongol Yuan dynasty 元 (1279-1368). Instead he wrote his essays Guoling dingyang 過零丁洋 and Zhengqi ge 正氣歌 to express his loyalty to the Song dynasty. He was detained in the Yuan empire's capital Dadu 大都 (modern Beijing) for four years and was finally executed.
Wen Tianxiang was a disciple of Ouyang Shoudao 歐陽守道 (1208-1272), who belonged to the Neo-Confucian school of Zhu Xi 朱熹 (1130-1200). One of his core concepts was that of the "primordial matter" (zhengqi 正氣) that constituted sun, moon and stars, while the "multiple matter" (haoran zhi qi 浩然之氣) formed mountains and rivers, as well as the human body. This matter included the spirit of the Heavenly principle (the dao 道 "Way") that was good and righteous by nature, so that the human body congenitally included spiritual goodness. The Way of Heaven was the rule that controled all objects on earth, and it was intrinsically embedded in all objects, not able to leave them. In the shape of the human body, the Dao strove unceasingly to become stronger.
For Wen Tianxiang, Confucian virtues as loyalty or devotion (zhong 忠), trustworthiness (xin 信) and sincerity (cheng 誠) were practical instruments that transformed the Confucian theory into reality. Devotion and filial piety (xiao 孝) were the highest goods of human virtue and the purest expressions of the goodness of the human character. They were the refined modes of all other forms of etiquette and the transformation of the Heavenly Way in human behaviour. Kindheartedness (ren 仁) was the highest duty (ren 任) of all humans and especially of the subjects of the ruler. Their devotion in the political sphere was to be directed towards the national altars (sheji 社稷, see also local deities). The nature of man as derived from Heaven obliged him to protect the well-ordered state against destruction and foreign occupants. Such a national concept was entirely new in Confucianism, where loyalty was only meant as a relation between ruler and minister and not as that between subjects and the dynasty.
The poems of Wen Tianxiang are often called historiographic (shishi 史詩), like his historical writings are called poetic (shishi 詩史). The most important writings of Wen Tianxiang are Zhinanlu 指南錄, Zhinan houlu 指南後錄, Yinxiaoji 吟嘯集, Jidushi 集杜詩 and Jinianlu 紀年錄. His collected works are assembled in the book Wenshan xiansheng quanji 文山先生全集 or Wenshan ji 文山集.