Mabinogion: fourth branch
The final and most complex branch of the four takes place in and around the Lleyn peninsula.
As Pryderi is governing Dyfed, Gwynedd is ruled by Math, son of Mathonwy.
Math's nephew Gilfaethwy has fallen in love with Math's beautiful foot-maiden Goewin. Gwydion, a magician, conspires to start a war so Gilfaethwy can be with her.
Gwydion steals some special pigs, a gift from the king of the Other World, from Pryderi to give them to Math. He then turns toadstools into 12 horses and 12 hounds, which he swaps for the pigs, though the following day they turn back into toadstools.
The cheated Pryderi assembles his army to get his pigs back from Gwydion. Math sets out to meet Pryderi's attack, yet while he's away from his court, Gilfaethwy rapes Goewin in Math's bed.
A truce is called after the battle. Pryderi, realising that Gwydion is his real enemy, fights him hand-to-hand at Tremadog Bay. Pryderi is killed when Gwydion uses magic against him. Math returns to his court, and Gwydion and Gilfaethwy slip away.
Math promises to marry Goewin after she reveals that Gilfaethwy has raped her. He turns Gifaethwy into a hind and Gwydion into a stag, and bans them food and drink within his kingdom.
Each year for the next three years, Math turns them into different animals and they're forced to give their young to Math. He turns their offspring into boys: Bleiddwn, Hyddwn and Hychdwn the Tall.
After three years, Math turns his nephews back to human form. He asks them to recommend another maiden to rest his feet on, and Gwydion suggests his sister Arianrhod.
When Math uses magic to test Arianrhod's virginity she reveals a golden-haired child, Dylan, who flees to the sea. Arianrhod runs away in disgrace but drops something small, which Gwydion hides in a chest at the foot of his bed.
One morning he wakes to hear a child crying. Inside the box he finds a baby boy, who is looked after by a woman in the town. By the time the child is four, he's bigger than one twice his age.
One day Math follows Gwydion to Arianrhod's castle where he tells her that the boy is her son. She refuses to acknowledge or name the boy. The following day Gwydion conjures a ship out of seaweed and leather and he and the boy sail to Caer Arianrhod near Dinas Dinlle.
Math changes their appearance to prevent Arianrhod from recognising them. Once in view of the fort they begin making beautiful shoes on the deck of the ship. Arianrhod sees the shoes and orders them to make a pair for her.
As Gwydion measures her feet, a wren lands on the ship's deck. The boy aims a needle at the bird's leg and breaks it. Arianrhod comments that 'the fair boy has a deft hand', which provides his name: Lleu Llaw Gyffes (fair skillful hand). Angry at being tricked into naming the boy, Arianrhod swears that he'll never carry weapons unless she gives them to him.
When Lleu grows up Gwydion disguises them as storytellers and they trick Arianrhod into believing the country is at war. In panic, she gives the boy armour and weapons. When she realises who they are she swears that Lleu will never have a human wife.
Gwydion and Lleu go to Math and tell him about Arionrhod's curse. They create a wife for Lleu out of the flowers of the oak, the meadowsweet and the broom from the forest, naming her Blodeuwedd. Lleu and Blodeuwedd marry and Math gives them the lands of Eifionidd and Ardudwy to rule.
They move their court to Mur Castell, overlooking Trawsfynydd. Soon afterwards Blodeuwedd falls in love with a neighbouring lord, Goronwy Pefr of Penllyn, and they plot to kill Lleu.
Lleu is no ordinary mortal. He cannot be killed inside a house, nor outside one, on horseback, or on foot. Blodeuwedd tricks him into revealing that can be killed only by a spear which must be a year in the making, but he must be standing with one foot on a trough built on the side of a river with a roof over it, with the other foot on the back of a billy goat.
Blodeuwedd tells Goronwy, who begins work on the spear. A year later she asks Lleu to show her how he should stand in order to be killed. As he does, Goronwy throws the spear at him, but Lleu turns into an eagle and flies away.
Goronwy goes to live with Blodeuwedd and takes control of Lleu's land. Gwydion is heartbroken, and searches all over Wales until he finds Lleu perched in an oak tree in the Nantlle valley below Snowdon.
Gwydion changes Lleu back to human form but he's weak through illness, and Gwydion carries him back to Math's court.
When fully recovered, Lleu plans revenge on Blodeuwedd and Goronwy Pefr. Blodeuwedd tries to run away but Gwydion catches her at Llyn Morwinion. He turns her into an owl, ensuring that other birds will attack her if she shows her face in daylight again.
Gwydion and Lleu overcome Goronwy, making him stand in the same position as Lleu did when the spear was thrown. Lleu does, however, allow Goronwy to use a stone as a shield. Lleu throws the spear so that it pierces the stone and kills Goronwy.
The stone is said to still exist, at Llech Ronw in the Cynfal Valley.