During the latter half of the 19th century, bands of Chinese warriors known as "flag gangs" ravaged large areas of northern Laos. Outlaws and freebooters, the flag gangs were fleeing the suppression of the Taiping rebellion in China. Tonkin (now northern Vietnam) was invaded first, when units of the "Black Flags" and the rival "Yellow Flags" crossed the China-Vietnam frontier in 1865 and set up bases in the upper reaches of the Red River Valley.