The Treaty of Tarbagatai or Treaty of Chuguchak of 7 October [25 September [[Old Style|O.S.]]] 1864 was a border protocol between Qing China and the Russian Empire that defined most of the western extent of their border in central Asia, between Outer Mongolia and the Khanate of Kokand. The signatories were, for Russia, Ivan Zakharov, consul-general of Ili, and Ivan Fedorovich Babkov, colonel of the Separate Siberian Corps of the General Staff, and, for China, Ming I, general of Uliastai; Hsi Lin, amban of Tarbagatai; and Bolgosu, Tarbagatai brigade commander. By this agreement, Russia gained about 350000sqmi of territory at the expense of Chinese Xinjiang, and Lake Balkhash went from lying on the border to being entirely surrounded by Russia. It is sometimes numbered among the "unequal treaties".
A Russian and Chinese border commission assembled at T'a-ch'eng (also known as Tarbagatai or Chuguchak) in China on 13 May 1861 in order to map the western border in accordance with Article III of the Treaty of Peking of 1860. The actual surveying did not begin until 11 July 1862. Both countries sought to influence the survey by the threat of military force and by alliances with local tribes, but the Russian delegation was under orders to insist on a border determined by topography and not by the boundaries between local ethnic groups. According to Babkov, "The deployment of our forces on the border clearly demonstrated to the Chinese that we had the means to uphold our demands with an armed hand whenever we wished. [This deployment] on our side of the Chinese pickets, under no circumstances can be considered a violation of international law or of friendly relations: all forces are deployed on the lands of the Kirghiz, who are Russian subjects, and ... are under strict orders never to cross the permanent Chinese picket line."
Negotiations were burdened by disagreements in interpreting Article II of the Treaty of Peking. The Chinese argued that it could not be taken as the basis for negotiations since the Chinese delegate who negotiated it was ignorant of central Asian conditions. The article also failed to distinguish between the different Chinese picket lines. The Chinese delegation argued that the outermost picket line was intended, while the Russians insisted that only the innermost picket line of permanent control could count. Both claimed the inhabitants between the two picket lines as their own subjects. The Russians rejected all Chinese maps as unscientific. The first round of negotiations ended in failure in September 1862.
In the summer of 1863 the Russians sent out an independent survey team, which resulted in skirmishes between Russian and Chinese troops. The objective of Russian policy in settling its border with China in 1858–64 was to establish control over a region and negotiate recognition of its sovereignty after the fact. The intensification of the Dungan Revolt that broke out in the spring of 1862 drew China's attention away from the border and toward internal security in Xinjiang. When the Chinese finally signed a protocol delimiting the border in Russia's favour, the delegates warned the Russians that the rebels were approaching Tarbagatai. The rebel leader, Yaqub Beg, initially refused to recognise the new border and recruited Kirghiz from the Russian side. As a result of the rebellion, the border markers, which were to be set up in 1865, were not put in place until 1869. Further border protocols were signed at Khovd in 1869 and at Tarbagatai in 1870.