In 1571, Altan Khan of Mongols received the title "Prince of Shunyi" (Obedient and Righteous Prince) from the Longqing Emperor, thus reaching an agreement of lasting peace with Ming. Since then, the city of Zhangjiakou was transformed from a military base to an important horse market for Mongolian mounts imported into China. From 1727 it was an important station for the Kyakhta trade between Russia and China. In early autumn long lines of camels would come in from all quarters for the conveyance of the tea chests from "Kalgan" (Zhangjiakou) to Kyakhta across the Gobi Desert. Each caravan usually made three journeys in the winter. In the 19th century some Russian merchants had permanent residences and warehouses just outside the gate.