He is one of the most well-known military generals of his time due to his humble background, outstanding command abilities, strength and valour in battle.
Xue Rengui was born in 614, during the reign of Emperor Yang of Sui, but his early activities were not recorded, other than that his wife had the surname Liu (柳).
Xue, despite his low military rank, believing himself to be powerful and wanting to show his ferocity, decided to lead the charge.
In 657, when the general Su Dingfang attacked Western Turkic Khaganate's Shaboluo Khan Ashina Helu (阿史那賀魯), Xue submitted a suggestion that if the wife and children of the chief of one of Western Turkic Khaganate's constituent tribes, Nishu Tribe (泥孰), who did not particularly support Ashina Helu but was forced to comply after Ashina Helu took his wife and children hostage, were to be captured by Tang forces, that they be immediately released so that the chief of Nishu would submit to Tang.
After the army returned to Tang territory, however, Xue was charged with killing those who had already surrendered and seizing the spoils of war and arrested for a time, but was eventually released after Emperor Gaozong ruled that the achievements outweighed the crimes.
After Guo's army collapsed, Xue was himself attacked by the Tibetan prime minister Gar Trinring Tsendro ("Lun Qinling" (論欽陵) in Chinese) at the Dafeichuan.
Emperor Gaozong sent the official Le Yanwei to the front to put Xue, Guo, and Ashina under arrest, but released them once they were brought back to the capital Chang'an.
At later time, when the people of Goguryeo were rising in resistance to Tang occupation, Xue was put in charge of pacifying the region, but yet later, probably in 675, Xue was deposed for reasons not clearly stated in historical records and exiled to Xiang Prefecture (象州, roughly modern Laibin, Guangxi), only allowed to return from exile when a general pardon was declared.
His presence intimidated the Eastern Tujue soldiers, who had thought that he was long dead, and he scored a major victory over Ashide Yuanzhen.
His tenure as General of Andong Protectorate following the fall of Goguryeo has been dramatized in a popular Korean television series called Dae Jo-yeong, and portrays Xue Rengui as a Tang general who is constantly frustrated by the insurgency of the Dongmyeongchun League; remnants of the Goguryeo underground resistance against the Tang.
According to this television action-drama, broadcast worldwide on KBS-1, Xue Rengui could finally claim victory over the Goguryeo insurgency when he had Dae Joyoung and his legion of escaped Baekje, Goguryeo, Khitan, and Silla prisoners cornered, and had Dae Joyoung vow loyalty to the Tang Empire, and become a military officer of high-rank in the Tang army.
But this is apparently a symbolic gesture made by the show's producers, since General Xue Rengui died in 683, to indicate his good and friendly nature and his disdain for political matters.
A "ballad-narrative" (說晿詞話) known as "The story of Xue Rengui crossing the sea and Pacifying Liao" (薛仁貴跨海征遼故事)[5] was written in the Suzhou dialect of Wu Chinese.
[6] He also appears famously as a hero in Chinese folklore in which he is the father of the fictional general Xue Dingshan and the father-in-law of the Turkic princess Fan Lihua.
In Xue Rengui's Expedition to the East, he was bestowed five treasures from Jiutian Xuannu: a whip that could subdue even a white tiger, a cannon that fired a stream of water, the Zhentian bow, an arrow that could penetrate even the clouds, and a wordless holy scripture.
Twelve years later, he finally subdued Dongliao, bringing the region under his control, triumphantly returned, and was awarded the title of the King of Pingliao.
Xue Rengui also sometimes appears as a door god in Chinese and Taoist temples along with the Korean general Yeon Gaesomun.