Nguyễn Ánh, whose family, the Nguyễn family, had been decimated by the Tây Sơn rebellion when he was 16 or 17, received the protection and aid of the French Catholic priest Pigneau de Béhaine, titular bishop of Adran.
In order to obtain support for Nguyễn Ánh's cause, Pigneau de Béhaine went to France in 1787 as the "special envoy of the king of Nam Ha", accompanied by Nguyễn Ánh's older son, Nguyễn Phúc Cảnh, who was then seven years old, as a token of Pigneau's authority to negotiate in the name of Nguyễn Ánh.
The 1787 Treaty of Versailles was signed on November 21, 1787, by Montmorin, Minister of Foreign Affairs and the Navy, and Pigneau de Béhaine, as the representative of Nguyễn Ánh. In return for the treaty, Nguyễn Ánh promised to cede Pulo-Condore to the French and to give a concession to the French in Tourane (modern Da Nang), as well exclusive trading rights. Louis XVI promised to help Nguyễn Ánh to regain the throne, by supplying 1,650 troops (1,200 Kaffir troops, 200 artillery men and 250 black soldiers) on four frigates.
That treaty marks the beginning of French influence in Indochina, but the Governor of Pondicherry, Count de Conway, who was given authority to decide on the actual implementation of the Treaty, refused to follow through with it, leaving Pigneau de Béhaine to his own means.
In spite of these inconveniences, between 1789 and 1799 a French force mustered by Pigneau de Béhaine managed to support Gia Long in acquiring sway over the whole of Vietnam. The French trained Vietnamese troops, established a navy, and built fortifications in the Vauban style, such as the Citadel of Saigon. Several of these French adventurers would remain in high positions in the government of Gia Long such as Philippe Vannier, Jean-Baptiste Chaigneau, de Forsans and the doctor Despiau.