The Buryats fought against Russian invasion since the 1620s and thousands of Buryats were massacred. The Buryat region was formally annexed to Russia by treaties in 1689 and 1727, when the territories on both the sides of Lake Baikal were separated from Mongolia. In 1689 the Treaty of Nerchinsk established the northern border of Manchuria north of the present line. The Russians retained Trans-Baikalia between Lake Baikal and the Argun River north of Mongolia. The Treaty of Kyakhta (1727), along with the Treaty of Nerchinsk, regulated the relations between Imperial Russia and the Qing Empire until the mid-nineteenth century. It established the northern border of Mongolia. Oka Buryats revolted in 1767 and Russia completely conquered the Buryat region in the late 18th century. Russia and Qing were rival empires until the early 20th century, however, both empires carried out united policy against Central Asians.