勤王運動
Upon Tự Đức's death, Phan almost lost his life during a power struggle in the imperial court. The regent Tôn Thất Thuyết disregarded Tự Đức's will of succession, and three emperors were deposed and killed in just over a year. Phan protested against Thuyet's activities, was stripped of his honours and briefly jailed, before being exiled to his home province. At the time, France had just conquered Vietnam and made it a part of French Indochina. Along with Thuyet, Phan organised rebel armies as part of the Cần Vương movement, which sought to expel the French and install the boy Emperor Hàm Nghi at the head of an independent Vietnam. This campaign continued for three years until 1888, when the French captured Hàm Nghi and exiled him to Algeria.