Tonkin, or Bắc Kỳ, was a French protectorate encompassing modern Northern Vietnam. Like the French protectorate of Annam, Tonkin was still nominally ruled by the Nguyễn dynasty, but in 1886, the French separated Tonkin from the Nguyễn imperial court in Huế by establishing the office of "Viceroy". However, on 26 July 1897, the position of Viceroy was abolished, officially making the French resident-superior of Tonkin both the representative of the French colonial administration and the Nguyễn dynasty court in Huế, giving him the power to appoint local mandarins. In 1887, Tonkin became a part of the Union of Indochina.