The Black Flags (from Chinese Hei qi jun) were Chinese irregular soldiers who raged in Indochina, mainly against the French.
They are former Taiping rebels commanded by Liu Yongfu (1837-1917, Luu Vinh Phúc or Luu Vinh Phuuc in Vietnamese). They were expelled from China in 1864 to Tonkin, after the crushing of their revolt (1850-1864).
The Annamites use them against the mountain tribes, between the Red River and the Black River. As such, Liu Yongfu obtained an official rank at court.
The Black Flags then harass the French on the Red River. An expeditionary force commanded by Henri Rivière was sent in 1881:it was the Franco-Chinese war (1881-1885).
The Black Flags then fought with the Chinese Imperial troops against the French (the Imperials tolerated these former rebels on the condition that they remained outside of China).
They participated in particular in the siege of French troops (mainly the Foreign Legion) in Tuyen-Quang in 1885 in Tonkin.