Xue was born in the south ancestor of Xue family in Hedong, and joined the army at the end of Zhenguan. He fought for decades, defeated Tiele, surrendered to Koguryo, and defeated the Turks. He made outstanding contributions, leaving behind the plan of "letting it go", "Three arrows set Tianshan Mountain", "bravely taking Liaodong", "benevolent ruling Korea", "loving the people like a city" and "taking off his hat to repel ten thousand enemies". Xue Lei is the governor of Guazhou, Shang Shu, the right leader, General Wei, and the school is on behalf of the state, sealing Pingyang County.
Xue joined the army in the last years of Emperor Taizong's Zhenguan (627-649) and defeated Goguryeo in the Anshi Rebellion. In the third year of Xianqing (658), Yugui Duancheng (located in present-day Hunhe area of Liaoning Province) defeated the Koguryo army again. The following year, he fought with General Wen Shamen of Goguryeo in Hengshan and Shicheng. 12, defeated the Khitan in Montenegro and captured the Khitan king Abu Gu alive. In the first year of Longshuo (66 1), the nine surname Tiele was defeated. In the first year of Ganfeng (666), he participated in the destruction of Koguryo. In the first year of Yongchun (682), the battle of Yunzhou defeated the Turks.