sentences:  In the latter half of 1875, during the domestic crisis caused by the Margary Affair, when British authorities put pressure on the Qing government for the murder of a junior British diplomat, Augustus Margary, during a trip to explore trade routes between British India and China's provinces, Xue Fucheng acted as advisor for Li Hongzhang in his negotiations with Britain.The crisis was resolved in 1876 with the signing of the Chefoo Convention.In 1879, Manchu Prince Gong, head of the Zongli Yamen, China's equivalent of the Foreign Office, agreed to give over control and defense of China's coast to Robert Hart, then Inspector-General of China's Imperial Maritime Custom Service (IMCS).