A yamen (ya-men; traditional Chinese: 衙門; simplified Chinese: 衙门; pinyin: yámén; Wade–Giles: ya-men; Manchu: ᠶᠠᠮᡠᠨyamun) was the administrative office or residence of a local bureaucrat or mandarin in imperial China, Korea, and Vietnam. In some places, such as Kowloon Walled City, Hong Kong, it was named as almshouse. A yamen can also be any governmental office or body headed by a mandarin, at any level of government: the offices of one of the Six Ministries is a yamen, but so is a prefectural magistracy. The term has been widely used in China for centuries, but appeared in English during the Qing dynasty.