The upper Ili Valley is separated from the Dzungarian Basin in the north (by the Borohoro Mountains), and from the Tarim Basin in the south (by the Tian Shan). This region was the stronghold of the Qing administration in Xinjiang in the late 18th and 19th centuries. It was occupied by Russia from 1871 to 1881 (from the Yaqub Beg rebellion until the Treaty of Saint Petersburg (1881)).