Wen Tianxiang 文天祥 (1236-1283), courtesy name Wen Lüshan 文履善 or Wen Songduan 文宋瑞, style Wenshan xiansheng 文山先生, was a late Southern Song period 南宋 (1127-1279) writer and philosopher. Chinese historians often hail him as an ardent patriot in the face of the Mongol invasion. He came from Jizhou 吉州 ( modern Ji'an 吉安, Jiangxi) and obtained the jinshi degree (see state examinations) 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 enfeoffed as Duke of Xinguo 信國公.
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 Xiudao 歐陽守道 who belonged to the Neo-Confucian school of Zhu Xi 朱熹. One of his core concepts was that of the "pristine matter" (zhengqi 正氣) that constitutes sun, moon and stars, while the "multiple matter" (haoran zhi qi 浩然之氣) forms mountains and rivers, as well as the human body. This matter includes the spirit of the Celestial principle (the dao 道 "Way") that is good and righteous by nature, so that the human body congenitally includes the spiritual goodness. The Way of Heaven is the rule that controls all objects on earth, and it is intrinsically embedded in all objects, not able to leave them. In the shape of the human body, the dao strives 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 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 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 文山集.