Tang was born in Huize county in 1883 in what is Qujing, Yunnan province. He passed the Imperial examination in 1903 and was selected by the Qing government to study military theory at Tokyo Shimbu Gakko in Japan the following year. While in Japan he met Sun Yat-sen and became a member of the Tongmenghui revolutionary society dedicated to overthrowing the monarchy. In 1907 he continued on to the Imperial Japanese Army Academy. Returning to Yunnan in 1909, he served in a number of military posts in the New Army. In 1911, under the command of Gen. Cai E, he participated in the Wuchang Uprising, which marked the start of the Xinhai Revolution that eventually toppled the Qing dynasty.