The story opens with Bendigeidfran (Bran the Blessed), King of Britain, sitting on a rock by the sea at Harlech and seeing the vessels of Matholwch approaching. Matholwch has come to ask for the hand of Bendigeidfran's sister Branwen in marriage. Bendigeidfran agrees to this, and a feast is held to celebrate the betrothal. While the feast is going on, Efnisien, a half-brother of Branwen and Bendigeidfran, arrived and asked why there were celebrations. On being told, he was furious that his half sister had been given in marriage without his consent, and vented his spleen by mutilating Matholwch's horses. Matholwch was deeply offended, but was conciliated by Bran who gave him a magical cauldron which could bring the dead to life.

Once they were married, Matholwch treated Branwen cruelly and she was forced to work in the kitchens. Branwen tamed a starling and gave it a message to carry across the Irish Sea to Bran, who set out for Ireland to rescue her. When Matholwch saw the giant, he asked for peace and built a house big enough for him. Matholwch agreed to give the kingdom to Gwern, his son by Branwen. The Irish lords did not like the idea, so they hid themselves in flour bags to attack the Welsh. Efnisien guessed what was happening and killed them by squeezing their heads inside the sacks, then threw Gwern into the fire.

In the ensuing war, all the Irish were killed save for five pregnant women who repopulated the island, while only seven of the Welsh survived to return home with Branwen, taking with them the severed head of Bendigeidfran. On landing in Wales at Aber Alaw Branwen died of grief that so much destruction had been caused on her account.