Gruffydd, took over as head of the family. Gilbert de Clare, Earl of Pembroke, rebuilt Carmarthen Castle in 1145, then began a campaign to reclaim Ceredigion. He built a castle in the commote of Mabudryd, but Cadell, aided by Hywel ab Owain Gwynedd who held Ceredigion for Gwynedd, destroyed it in 1146. Rhys appears in the annals for the first time in 1146, fighting alongside his brothers Cadell and Maredudd in the capture by assault of Llansteffan Castle. This was followed by the capture of Wiston in 1147, Carmarthen in 1150 and Loughor in 1151. In 1151 Cadell was attacked while out hunting by a group of Norman and Flemish knights from Tenby, and left for dead. He survived, but suffered injuries which left him unable to play an active role, and in 1153 he left on a pilgrimage to Rome. Maredudd became ruler of Deheubarth and continued a campaign, begun in 1150, aimed at recovering Ceredigion, which had been held by Gwynedd since 1136. Maredudd and Rhys drove Hywel ab Owain Gwynedd from Ceredigion by 1153. The same year Rhys is recorded as an independent commander for the first time, leading an army to capture the Norman castle of St Clears. Maredudd and Rhys also destroyed the castles at Tenby and Aberafan that year. Maredudd died in 1155 at the age of twenty-five and left Rhys as ruler of Deheubarth. Around this time he married Gwenllian ferch Madog, daughter of Madog ap Maredudd, prince of Powys. Early reign Loss of territory (1155–1163) Shortly after becoming ruler of Deheubarth, Rhys heard rumours that Owain Gwynedd was planning to invade Ceredigion in order to reclaim it for Gwynedd. Rhys responded by building a castle at Aberdyfi in 1156. The threatened invasion did not take place, and Turvey claims that Owain's intention may have been to test the resolve of the new ruler. King Stephen had died in October 1154, bringing to an end the long dispute with the Empress Matilda which had helped Anarawd, Cadell and Maredudd to extend their rule in Deheubarth. With disunity within the realm no longer a problem, the new king of England, Henry II, soon turned his attention to Wales. He began with an invasion of Gwynedd in 1157. This invasion was not entirely successful, but Owain Gwynedd was induced to seek terms and to give up some territory in the north-east of Wales. The following