The Kowloon Walled City was orginally a garrison town built by the Qing government in 1847 as a military outpost occupied by several hundred soldiers to reinforce the coastal defence of the region. The Yamen building was originally the administrative office of the Assistant Magistrate of Kowloon. The building is a three-hall structure. The middle hall was the office while
the rear block served as the officer's residence. After the departure of the Qing officials in 1899, the Yamen building was used by different religious groups including a home for the aged, home for widows and orphans, school and clinic. In 1996 the Yamen was preserved and restored to remind the people of its historical past.