After the murder of Gruffydd ap Llywelyn, Harold Godwinson married his widow Ealdgyth and divided Gruffydd's realm into the traditional kingdoms of Gwynedd and Powys, the rule of which were given to Bleddyn ap Cynfyn and his brother Rhiwallon ap Cynfyn. Gruffydd left two sons Maredudd and Idwalwho in 1070 challenged Bleddyn and Rhiwallon at Mechain in an attempt to win back part of their father's kingdom. However, both sons were defeated, Idwal (or Ithel) being killed in combat and Maredudd dying of exposure after the battle.
