Leinster. He was succeeded by Domnall ua Néill, and in the following decades alliances shifted constantly between the different branches of Uí Néill, Leinster and Dublin. In 980 Máel Sechnaill mac Domnaill succeeded Domnall, and the same year he defeated the forces of Dublin at the battle of Tara. Following this victory Máel Sechnaill forced Dublin into submission, and his half-brother, Amlaíbs son Glúniairn, became ruler in Dublin. Máel Sechnaill mac Domnaill and Brian Boru (980–1022) In Munster, the influence of the Dal gCais had grown under Cennétig mac Lorcáin, and his son Mathgamain was the first non-Eóganachta ruler to be named by the annals as king of Cashel (i.e. king of Munster) in historical times. He was killed in 976, and succeeded by his brother Brian, later famously known as Brian Boru. Brian quickly established himself as the most powerful ruler in Munster, defeating the Norse of Limerick in 977 and the Eóganachta the following year. Having gained control over Munster, he tried to extend his authority by raiding Osraige in 982 and 983, and also, according to the annals of Innisfallen, entering an alliance with the Norse of Waterford, with the intention of attacking Dublin. There was such an attack, but Brian does not seem to have been involved – instead it was Domnall Claen of Leinster who was allied with Ivar of Waterford, and they were defeated by Glúniairn and Máel Sechnaill. Máel Sechnaill obviously perceived Brian as a threat, and as early as 982 raided Munster and the territory of the Dal gCais. The next two decades saw more or less constant warfare between them, mostly with Leinster as their battleground. Even if Brian never defeated Máel Sechnaill in battle, Brian's and Munster's influence was growing at the expense of Máel Sechnaill and the Southern Uí Néill. In 997 Máel Sechnaill was forced to acknowledge Brian's authority over the south of Ireland, and they formally divided Ireland according to the traditional scheme of Leath Cuinn and Leath Moga. In the years that followed, the two of them acted as allies in accordance with this agreement. In 999 Brian quelled a revolt against him by the men of Leinster and Dublin at the battle of Glen Mama, and only restored Sigtrygg Silkbeard as ruler of Dublin after he had formally submitted to Brian by handing over hostages. In 1000, Brian turned against Máel Sechnaill, and by 1002