 Rhys had nominated his eldest legitimate son, Gruffydd ap Rhys, as his successor, and soon after his father's death Gruffydd met the Justiciar, Archbishop Hubert Walter, on the border and was confirmed as heir. Maelgwn, the eldest son but illegitimate, refused to accept this and was given military assistance by Gwenwynwyn ab Owain of Powys. Maelgwn took the town and castle of Aberystwyth and captured Gruffydd, whom he handed over to the custody of Gwenwynwyn. Gwenwynwyn later handed him over to the king, who imprisoned him at Corfe Castle. Gruffydd was set free the following year and regained most of Ceredigion. In 1201 Gruffydd died, but this did not end the fighting between rival claimants. In 1216 Llywelyn the Great of Gwynedd held a council at Aberdyfi where he allocated parts of Deheubarth to several sons and grandsons of Rhys.
