Chiang Kai-shek formed the Whampoa Military Academy years later, Xue was one of the members of the first graduating class.
He proved himself as an able officer during the Northern Expedition and the civil war against the Communist forces. After the Xi'an Incident where Chiang Kaishek was abducted and forced to reconcile with the Communists against the common enemy of Japan, Xue's relationship with the Nationalist Party was strained as word had gotten out that he had not only been in favor of abducting Chiang but also suggested that Chiang should be placed under arrest if Chiang failed to cooperate with the Communists as he had agreed to under coercion.
During the Second Sino-Japanese War, Xue again shined as a tactician. On more than one occasion he disobeyed direct orders based on his field observations, and often turned disadvantageous situations into small victories. Chiang promoted him to the rank of a full general after seeing his successes early in the war. He led troops during the defenses at Wuhan and Changsha; both of the battles inflicted significant casualties among the Japanese ranks. American General Claire Chennault quoted Xue as "the Patton of Asia", though General Joseph Stilwell disagreed on Xue's trustworthiness, who refused to provide Xue's troops with ample ammunition. This event placed a strain between the working relationship between Stilwell and Chennault, but at the same time made Xue and Chennault personal friends. Before Chennault left China in May 1945, he and Xue became sworn brothers.
After the end of the Second Sino-Japanese War, Xue participated in the resumed civil war with the Communists. He was placed in charge of defending Hainan, the Nationalists' last stronghold in China. His troops were defeated by Lin Biao, and Xue became the last general to reach Taiwan. Refusing a government post offered by Chiang, Xue retired from the Chinese Army. He was given 10 years of back pay with interest with a generous pension, making him a very wealthy man.