Chief Justice of the British Supreme Court for China and Japan
British Consul-General, Shanghai
From 1871 to 1874 he was appointed Acting Assistant Judge of the British Supreme Court for China and Japan and was based in Yokohama. Following this, he returned to Shanghai to private practice. In 1878 he was appointed Crown Advocate of the Supreme Court, a position akin to that of a colonial attorney general. The Crown Advocate was allowed to accept cases from private clients that did not affect their duties as Crown Advocate. In 1881, he was appointed as Judge for the British Court for Japan in Yokohama. Before taking up the appointment, he acted as Chief Justice of the British Supreme Court for China and Japan for more than one year until the new Chief Justice, Sir Richard Rennie, returned from long leave to take up the post. In 1891, on Rennie's retirement, he was appointed as Chief Justice of the British Supreme Court for China and Japan and :zh:英国驻上海总领事列表|Consul-General in Shanghai. This appointment was the first and only time the Chief Justice also served as Consul-General. There was much opposition from foreign residents in China to the amalgamation of the positions. The opposition was not based on Hannen's ability but rather that it was inappropriate for one man to hold a judicial and executive position at the same time. The position of Chief Justice and Consul General were separated in 1897 and Hannen continued as Chief Justice. George Jamieson who had been Assistant Judge and Consul was appointed Consul-General. Frederick Bourne took over the position of Assistant Judge. Hannen was knighted on 18 July 1895 at Windsor Castle and received the Jubilee Medal in 1897.
Death
Hannen was due to retire in May 1900. He died of heart failure, brought on by an attack of pneumonia on 27 April 1900. His death came just two weeks before his planned retirement and departure from Shanghai for the town of Wargrave, near Reading, Berkshire, where he owned a house, Lake Lodge. Funeral services were conducted for Hannen at Trinity Cathedral in Shanghai and he was given full honours. Marines from acted as an honour guard and pallbearers. He was cremated and his ashes taken back to England. In 1907 his ashes were lodged in the Hannen Mausoleum, a columbarium designed by Edwin Lutyens and built for the Hannen family in the churchyard of St Mary's Church in Wargrave. Hannen's successor as Chief Justice of the Supreme Court was Hiram Shaw Wilkinson, then judge of the British Court for Japan who had also succeeded Hannen as Crown Advocate in 1881.