He appears in the First Branch of the Mabinogi as the main rival of Arawn, the other king of Annwn.
In the story Pwyll, Prince of Dyfed, Pwyll, in order to gain Arawn's friendship, agrees to switch places with him for one year and one day and to battle against Hafgan in order to rid Arawn of his difficulty.
Before they exchange places, Arawn gives specific instructions to Pwyll to kill him with one stroke and no more.
"[1] In one year Pwyll, wearing the guise of Arawn, goes to battle and succeeds in injuring Hafgan nearly to death, breaking through his shield and armor and knocking him to the ground.
Just as Arawn had warned, Hafgan pleaded that Pwyll finish the slaughter and kill him thoroughly.