Mac King Temple is the 16th century palace of the Mac Dynasty. It is located on a hill top above the Lang Den. It is located on the west bank of the Dau Gen River, which is a tributary of the Bang Giang River. The construction of this palace is credited to a general of the Le Army in 1521 – 1522 after he forcibly dethroned the 11 year King Le Chieu Tong, exiled him and installed his brother Le Thung as the king. However, two years later Le Chieu Tong was reinstalled as the King of Dai Viet. The Mac Dynasty then ruled for 65 years. The Le dynasty continued to fight the Mac Kings and finally succeeded to regain power in 1592 for a short time with the help of the powerful Trin family. A nephew of Mac Mau Hop took control of Cao Bang and three generations of his family ruled for 75 years till the armies of the Trin family captured Cao Bang in 1667. The small palace building has canons placed near the main entrance even now.