The site where Caerphilly Castle now stands was once the location of a Roman fort dating back to around 75 AD. The fort was abandoned in the mid 2nd century and the land remained unoccupied for the next 1,000 years.

Caerphilly castle was begun by Gilbert de Clare in 1268 under orders from King Henry III. Before it was completed it was burnt to the ground by Gruffydd ap Llewelyn, the Prince of Wales. Construction of the present castle recommenced in 1271 and was completed without suffering further attack.
When the de Clare male line died out, the castle passed into Royal hands for a short time. The castle was besieged in 1316; however an army of ten thousand men, led by Llywelyn Bren, failed to breach its powerful defences.

The castle later passed to Hugh le Despenser who was married to Eleanor de Clare. Between 1322-6, he renovated the great hall and other domestic buildings. Hugh le Despenser was a favourite of King Edward II and shortly afterwards the castle underwent a 3 month siege by Isabella, the wife of King Edward. The castle was abandoned and began to fall into ruin.