Dinefwr Castle stands on a ridge on the north bank of the River Towy in Carmarthenshire, Wales. Dinefwr was the chief seat of the Principality of Deheubarth.
It is said that the first castle on this site was built by Rhodri the Great, and the castle later became the chief seat of Hywel Dda, first ruler of Deheubarth and later “king of the Britons” and king of most of Wales. Rhys ap Gruffydd (The Lord Rhys)
ruler of Deheubarth from 1155 to 1197 is thought to have rebuilt the castle, along with the spectacular castle at Carreg Cennen, just four miles away to the south.
“On Rhys ap Gruffydd's death the castle passed to his son Rhys Gryg, and the earliest parts of the present castle are thought to derive from this period. Llywelyn the Great of Gwynedd was now extending his influence to this area, and Rhys, finding himself unable to resist, dismantled the castle. Llywelyn however had it restored and held it until his death in 1240. In 1255 Llywelyn the Last gave Dinefwr to Rhys Fychan, then later gave it to Maredudd ap Rhys before later returning it to Rhys Fychan. Maredydd now allied himself to King Edward I of England, and helped Edward capture Dinefwr in 1277. Maredudd had apparently been promised Dinefwr in return for his help, but Edward did not keep his promise and had Maredudd executed in 1291.