 When Hà Nội surrendered to the French in 1883, the Nguyễn Văn Thương regime signed the Treaty of Huế (also known as the Harmand treaty) and acknowledged the French protectorate over the northern and central parts of the Vietnam.When he was ordered to stop fighting, Nguyen resigned from his post and retreated to Đông Triều, where he organized and continued armed resistance against the French.He also joined forces with the Black Flag Army led by Lưu Vĩnh Phúc.