The fall of Nanking and the collapse of the Taiping Heavenly Kingdom in 1864 altered Liu's prospects dramatically for the worse. Imperial forces gradually began to reassert their control over southwest China, and it was only a matter of time before they secured Guangxi province. To escape their vengeance, Liu needed to make himself sufficiently powerful to give the Imperial generals pause. His first step was to buy some time by retreating into the mountains of northern Tonkin. In 1868 he abandoned Wu Yuanqing's rebels and crossed into Vietnam with a force of 200 soldiers whose loyalty he could trust. He had dreamed as a youth that he would one day become a famous 'General of the Black Tiger', and christened his tiny band of adventurers the Black Flag Army, "heiqi jun" ("hei-ch'i chun", 黑旗軍). The Black Flags marched slowly through northern Tonkin, recruiting men to their standard as they went, and eventually set up camp just outside Son Tay, on the northern bank of the Red River.