The yamen (
衙门) was the administrative office and residence of a local mandarin in imperial China. It functioned as a courthouse, tax office, and seat of local government all in one. The term is sometimes used colloquially today to mean a stuffy bureaucratic office.