Having secured his base, Liu began to extend his ambitions. Ultimately, his intention was to carve out a small empire of his own controlling the upper course of the Red River. His first target was the border town of Lao Cai, which had recently been occupied by a force of Cantonese bandits under the command of He Junchang (Ho Chun-ch'ang, 何均昌). His band was allied with the Yellow Flag Army, a force established by Huang Chongying (Huang Ch'ung-ying, 黃崇英) on the model of the Black Flag Army and about three times its size. Liu's attempt on Lao Cai brought him into conflict with the Yellow Flags. Troops of both armies moved warily into the town while their leaders negotiated insincerely. Finally the Yellow Flags launched a surprise attack on the Black Flags, first setting off a mine in an unsuccessful attempt to kill the Black Flag leader. However, despite their superior numbers, they were defeated and driven from Lao Cai. The town remained in the hands of the Black Flags until 1885, and became Liu's main stronghold.