and capturing and executing the rebel leader Chen Kunshu, Li received a jiduwei peerage in recognition of his achievements. An incident connected with the surrender of Suzhou soured Li's relationship with Gordon. According to an earlier arrangement with Gordon, the rebel leaders agreed to yield Nanjing to imperial forces on the condition that their lives would be spared. However, after the capture of Nanjing, Li ordered the rebel leaders to be executed. This breach of faith infuriated Gordon so much that he grabbed a rifle and wanted to shoot Li, but Li fled. By the end of 1864, the Taiping Rebellion had basically been suppressed by imperial forces. Li was awarded a noble peerage as "First Class Count Suyi" () and the privilege of wearing a double-eyed peacock feather in his hat. As Viceroy of Zhili After the suppression of the Taiping Rebellion in 1864, Li assumed a civil office as the xunfu of Jiangsu Province for about two years. However, on the outbreak of the Nian Rebellion in Henan and Shandong provinces in 1866, he was ordered to lead troops into battle again. After some misadventures, Li managed to suppress the movement. In recognition of his contributions, he was appointed as Assistant Grand Secretary (). In 1867, Li was appointed as the Viceroy of Huguang, where he remained until 1870, when the Tianjin Massacre necessitated his transfer to Tianjin to handle the diplomatic crisis with the French. He was given the concurrent appointments as Viceroy of Zhili Province and Beiyang Trade Minister () to oversee various issues in Zhili, Shandong and Fengtian provinces, including trade, tariffs, diplomacy, coastal defence, and modernisation. He was also conferred the honorary position of "Grand Secretary of Wenhua Hall" (). From the time he became Viceroy of Zhili and Beiyang Trade Minister until his death, with a few intervals of retirement, he shaped the Qing Empire's foreign policy to a large extent. In 1876, he signed the Yantai Treaty with Sir Thomas Wade to end a diplomatic crisis with Britain caused by the murder of Augustus Raymond Margary in Yunnan Province. He also arranged treaties with Peru and the Tianjin Convention with Japan, and directed Chinese foreign policy in Korea. Among Li's projects to open China to the world on Chinese terms was support for the Chinese Educational Mission, which sent Chinese boys to the United States for education, starting in 1872. The mission