Lifan Yuan
In 1688, Longkodo entered the imperial court of the Kangxi Emperor, serving on the Imperial Guard. He then became deputy commander of the Plain Blue Banner in Mongolia. In 1705, Longkodo was found negligent for abuses committed by his subordinates, and dismissed from his positions. He resurfaced again in 1711, becoming the commander of the capital gendarmerie, better known as the "Jiumen Tidu" (九门提督), which acted as both a police and military force overseeing the imperial capital, Beijing, and its vicinity. In 1720, Longkodo was named the minister in charge of Lifan Yuan by the ailing Kangxi Emperor, overseeing affairs of ethnic-minority border regions.