The Yongle Emperor,
明成祖, set it up in 1420 north of the Dong'an Gate in Beijing, which gave it its name, and put trusted eunuchs in charge. It spied on officials and reported straight to the emperor, and its power came to exceed that of the
锦衣卫, from which many of its men were drawn. A Western Depot,
西厂, was added in 1477 but lasted only a few years.