There are fragments of conserved Key Gubad Mosque (XIV century) in the middle yard of the palace. The monument was destroyed by cannonballs shot by armenian dashnaks during the genocide of azerbaijanis on the 31st March 1918. Probably, the mosque was built by Shirvanshah Keygubad I who lived in the XIV century.