 He also often worked closely with the powerful Viceroy, Li Hongzhang and their final work together involved negotiating a settlement China could tolerate at the end of the Boxer Rebellion, when the Eight-Nation Alliance of Western forces took control of Peking to lift the Siege of the International Legations, after the Dowager Empress and her nephew the Guangxu Emperor had fled the city.Hart held his post till his retirement in 1910, although he left China on leave in April 1908, and was succeeded temporarily by his brother-in-law, Sir Robert Bredon, and then formally by Sir Francis Aglen.Hart died on 20 September 1911 after a cardiac decline following a bout of pneumonia.