Yes, the palace was built in the 13th century specifically to serve as the residence of the Bishops of Bath and Wells. It fulfilled this function for over 800 years until the last resident bishop left the premises in 1975.