 Llywelyn sent troops to help Gwenwynwyn, but in August Gwenwynwyn's force was attacked by an army led by the Justiciar, Geoffrey Fitz Peter, and heavily defeated.Gwenwynwyn's defeat gave Llywelyn the opportunity to establish himself as the leader of the Welsh.In 1199, he captured the important castle of Mold and was apparently using the title "prince of the whole of North Wales" ().