The Tuatha Dé had defeated the Fir Bolg at the first Battle of Magh Tuiredh and driven them to the West of Ireland. They did not enjoy precedence for long. Soon they had to do battle with the Fomhoire (The Fomorians) who lived on the western most islands and were also very powerful in magic.
During the first battle of Magh Tuiredh, Nuada the King had lost his arm and so according to ancient custom he had to stand down as ruler as defects were not allowed in sovereigns. Bres (The Beautiful) whose father Elatha was a king of the Fomhoire but who was raised among his mother's kin the Tuatha Dé, was chosen in his stead. Soon the rule of Bres however became oppressive and the country fell in thrall to the people of the Fomhoire. The Dagda was reduced to digging and building a fort for Bres and Oghma was reduced to fetching firewood. Moreover Bres lacked what is the mark of every true king namely generosity.
The chieftains of the Tuatha Dé complained that 'their knives were not greased by him and however often they visited him their breaths did not smell of ale' There was no entertainment for them in the royal household, no poets, musicians, acrobats or buffoons. In the end retribution was hastened by a poet's verses.
When Coirbre the poet of the Tuatha Dé was received by Bres with scant hospitality he retaliated with magic tipped satire, (the first that was made in Ireland) and nothing but decay was on Bres from that hour.
The chieftains of the Tuatha Dé demanded that he renounce his kingship. So he went out to muster an army of the Fomhoire to support him.
In the meantime Nuada had been fitted with a silver arm by Dian Cécht the physician and was reinstated in the sovereignty and from that time forward he was known as Nuada Lámhairgid (of the Silver Arm). Then Lugh the long-handed arrived on the scene and as soon as Nuada had proof of his technical abilities he relinquished the throne to Lugh in the hope that he would lead the Tuatha Dé to victory against the Fomhoire.
Under Lugh's leadership preparations are got underway and each of the craftsmen and magicians of the Tuatha Dé promises his own special contribution. The craftsmen fashion wondrous weapons. The sorcerers hurl the mountains of Ireland on the Fomhoire. The cupbearer's conceal from them the waters of Ireland's lakes and streams. The druids cast down on them showers of fire, and deprive them of two-thirds of their strength and courage, and bind in their bodies the urine of men and horses.
Once the battle was joined in earnest there was great slaughter on both sides. The slain of the Fomhoire remained so, but those of the Tuatha Dé were cast into a well over which Dian Cécht and his three children sang spells and by its magic they were restored to life. Lugh also used his powers, moving around his army on one foot and with one eye he chanted an incantation to lend them strength and courage. He thus assumed the traditional posture of the sorcerer and one which was attributed to the Fomhoire.
He then had to face the dreaded Balor of the Evil Eye. Balor's eye was such that he needed four men to raise the lid of it and when uncovered its venomous gaze could disable an army. As soon as Lugh saw the eye open against him he cast a sling-stone which drove it through to the back of Balor's head so that it wrought destruction on his own followers.
The Fomhoire were routed and expelled forever from Ireland. Bres was captured and sought to save his life by promising first that the cattle in Ireland should always be in milk, and secondly that there should be a harvest in every quarter of the year. Both offers were rejected but he was finally spared in return for advice on the proper times for ploughing, sowing and reaping.
With that the Tuatha Dé prospered in Ireland for many years to come and wanted for nothing.