composed the Hưng Hóa Gazettes under the name Quan Thành. In 1857, he was appointed Prefect of Quế Dương, and then Prefect of Lạng Giang. Afterwards he was promoted as a province official, holding posts such as Plantation Commissioner, Surveillance Commissioner, Administration Commissioner, and ultimately Governor of Bắc Ninh. In 1870–1871, Phạm Thận Duật took part in the campaign to neutralize bandits at the midlands border. In 1873, when the French, led by Francis Garnier, attacked the Hanoi citadel (see Conquest of Cochinchina), he was designated to govern Tonkin's provinces and appoint temporary government officials, becoming Patrol of Hà Nội. In 1874, he was appointed Patrol of Bắc Ninh, executing a successful campaign to eliminate bandits in the north. In 1875, he became the assistant to Tôn Thất Thuyết, responsible for the administration of two provinces, Bắc Ninh and Thái Nguyên. In 1876, Phạm Thận Duật was summoned to Huế to become Advisor of the Ministry of Personnel, as well as Vice Chief Officer of the Censorate. After 4 months, he was sent to the north to be the commissioner overseeing the maintenance of the Red River's floodbank and irrigation. In 1878, he was summoned to the Privy Council to become the mentor for emperor Tự Đức's princes Dục Đức and Chánh Mông. Subsequently, he was put in charge of the National History Institute and the Imperial College. He was appointed principal editor of The Imperially Ordered Annotated Text Completely Reflecting the History of Vietnam by emperor Tự Đức in 1884. Treaty of Huế and the Cần Vương movement Before the second French attack of Tonkin in 1882 (part of the Tonkin Campaign), Phạm Thận Duật had issued a secret report to the Huế court, laying out defensive measures against the enemy. He advocated for the construction of forts in critical mountainous areas, and anti-French military bases in Quảng Bình, Hà Tĩnh, with an especially large-scale one in Tân Sở, Quảng Trị. His plan was approved by the leading officials of the pro-confrontation faction of the court, Tôn Thất Thuyết and Nguyễn Văn Tường. Phạm Thận Duật headed the Nguyễn dynasty's diplomatic corps to Tientsin, China before the 1883 Tet holiday to discuss a joint resistance campaign against the French, but it proved unsuccessful. In early 1884, he was appointed the Chief General in the signing of the 19-article Treaty of Huế on June 6, 1884, which formed the basis