After this, he abandoned his naval career and worked as a military engineer for the Liang- Jiang Governor-General, Zhang Zhidong (Chang Chih-tung), a notable Qing (Ch’ing) dynasty official and reformer. He rose swiftly in his service and became one of Zhang’s military advisers. In this capacity, he was sent to Japan as an observer of military modernization in 1897, 1899 and 1902. In 1906, he received command of the newly formed 21st Mixed Brigade in Hankou. Hankou, and the rest of Hubei, was a center of anti-Qing revolutionary activity in the first decade of the 20th century. The new army units, like the one Li commanded, were the primary targets of revolutionary subversion. In 1910, he discovered his brigade was infiltrated by revolutionary society members and broke up a secret revolutionary society of officers. Despite this, the revolutionary movement continued to grow.
On 10 October 1911, after a premature bomb explosion alerted dynastic authorities to the imminence of another revolt, the revolutionaries struck to pre-empt government measures. They had initial success, driving the Qing officials from the Hankou region. However, none of their own leaders were present. The provincial revolutionary council named Li, because he was the senior officer present, as the head of the new provisional revolutionary government. Li, who was neither a revolutionary nor sympathetic to their cause, hid. As the story goes, he was discovered hiding under his bed and threatened with death unless he joined the revolutionary forces as leader. He agreed.
As the revolution gathered momentum and showed signs of success, Li became more enamored of the new government. He participated in revolutionary politics but remained in Hankou and military governor of Hubei when the government moved to Beijing (Peking). After Sun Yat-sen resigned as president to make way for Yuan Shikai (Yuan Shih-k’ai), Li was elected vice president of the republic. He still declined to move to Beijing.
After the collapse of the Second Revolution in 1913, started to protest Yuan Shikai’s high-handed rule, and the collapse of his own political position in Central China, he succumbed to Yuan’s armed blandishments and moved to the capital. There he was treated with all the honors and courtesies of the office of vice president, but had no real power. Neither able to resign nor to resist in any meaningful way, he became a passive participant in Beijing politics.
After Yuan’s death in 1916, Li became President of the Republic, but the office had been drained of all power by one of Yuan’s epigoni, Duan Jirui (Tuan Chi-jui), who became prime minister. Again, he was a figurehead. He was unable to resist Duan because he had no independent power base and no close relationship with the parliamentary opposition.
A major issue in Beijing during his first tenure as president was whether or not China should enter the First World War against the Central Powers. He did not oppose the idea of war against Germany, but did not like Duan’s method of achieving parliamentary consensus, through bribery. In March 1917 he refused to sign the Chinese government’s announcement it would sever ties with Germany unless the National Assembly also agreed. This led to a declaration of war without the approval of the President and the members of the National Assembly, a power struggle between the National Assembly and the Beiyang (Peiyang) military clique, the eruption of a small scale civil war, the temporary restoration of the Qing Dynasty, Duan’s eventual triumph and Li’s retirement.
Li discontinued all political activity and lived quietly in Tianjin between 1917 and 1922. That year, he was asked to serve as president of the Republic again to help broker a peace agreement between Northern and Southern factions of Chinese warlords. He agreed, received assurances from the principal parties that private armies and the military government system would be abolished, but still remained a figurehead. He resigned again and retreated to Japan for medical treatment. He returned to China in 1924 and lived in retirement in Tianjin until his death in 1928.