Gruffydd ap Llywelyn (~1000-1063) was the ruler of all Wales from 1055 until his death, one of very few able to make this boast. He was the son of Llywelyn ap Seisyll and a descendant of Rhodri the Great. On the death of Iago ab Idwal in 1039, Gruffydd unexpectedly seized control of Gwynedd, and successfully waged war with Mercia, then attacked the neighbouring principality of Deheubarth. By 1044, he had conquered Deheubarth, but lost it again in 1047. Allying himself with the Mercians, he proceeded to gain considerable ground along what is now the English border, and in 1055 he sacked Hereford. Deheubarth came back within his power in the same year, and he claimed sovereignty over the whole of Wales - a claim which was recognised by the English. Gruffydd reached an agreement with Edward the Confessor, but was less successful in holding off the incursions of Harold Godwinson. His own men deserted him, and he was murdered by them and his territory broken up among several successors.
Gruffydd ap Llywelyn (~1200-1244) was the eldest, illegitimate son of Llywelyn the Great. Under Welsh law, he might reasonably have expected to succeed his father, but Llywelyn had married a daughter of King John, and preferred his legitimate son, Dafydd, who was obliged to imprison his half-brother in order to secure his own inheritance. Following a successful invasion of the Welsh borders by King Henry III of England in 1241, the king took Gruffydd into custody. The headstrong and impatient Gruffydd fell to his death while attempting to escape from the Tower of London. This was the second time Gruffydd had found himself in English custody. As a boy, he had been one of the hostages taken by King John as a pledge for his father's good faith. One of the reasons for his shoddy treatment was that he presented a threat to his half-brother, Dafydd, who was half-English. Moreover, Gruffydd being a bastard in English eyes, it would be a bad precedent if he were allowed to inherit Gwynedd.