Dafydd ap Gruffudd was the youngest son of Gruffudd, the illegitimate offspring of Llewelyn ap Iorwerth (Llewelyn the Great). When Llewelyn the Great's heir Dayfydd died in 1246 he had no heir. His territory was divided among Gruffudd's four sons, Dafydd among them. Llewelyn ap Gruffudd received the northern stronghold of Gwynedd. In 1255 Dafydd and his brother Owain attempted to oust Llewelyn from Gwynedd. The two brothers were defeated at the Battle of Bryn Derwin, and Llewelyn put them both in prison.
Owain stayed in prison at Dolbadarn Castle for the next two decades, but Dafydd was free in a matter of months, probably because Llewelyn wanted to use him to help free the northern Welsh kingdoms from English influence. But the alliance between the two brothers did not last, and in 1263 Dafydd fled to Henry III's court and forged an alliance with the English king.
In 1267 Henry recognised Llewelyn as Prince of Wales, a title which did not sit well with powerful Welsh nobles, nor with Dafydd. Dafydd joined Welsh conspirators in a plot to assasinate Llewelyn, but the plot was uncovered and Dafydd fled back to England, to the court of Edward I, who had succeeded Henry to the throne. Edward in turn launched a successful attack on north Wales with Dafydd's help, and succeeded in pushing Llewelyn back to his Gwynedd stronghold. In return for his help, Edward granted Dafydd Welsh lordships, helped him build a castle at Caergwrle, and gave him the old fortress site at Denbigh. Edward's gifts did not satisfy the ever-truculent Dafydd, however, and on Palm Sunday, 1282 Dafydd launched a surprise attack on English positions in north Wales. He attacked the English castles at Flint, Rhuddlan, and Hawarden, and Llewelyn, against his natural inclinations, was drawn into the affray to support Dafydd's ill-considered revolt.
The revolt was doomed to failure from the start. Dafydd fled to Castell-y-Bere, and when that fortress fell to the English he lived on the run for several months before he was captured by the English. He was taken to Shrewsbury and there hung, drawn, and quartered, a punishment invented by Edward to deal with cases of treason.
What are we to make of this violent and unpredictable character? Dafydd ap Gruffudd is often described in unflattering terms by historians, who use phrases like 'fickle', 'unbalanced', and 'volatile' to describe his behaviour. But he was a man of his times; ambitious, certainly, and changeable. Not a man blessed with the greatest sensibility or political vision. But such were the times in which he lived, and he was not the only ambitious nobleman to live a turbulent life and die a violent death.