In 980, Olav Cuarán, King of Dublin, summoned auxiliaries from Norse-ruled Scottish Isles and from Mann and attacked Meath, but was defeated by Máel Sechnaill at Tara. Reginald, Olaf's heir, was killed. Máel Sechnaill followed up his victory with a siege ofDublin which surrendered after three days and nights. When Maél Sechnaill took Dublin in 980, according to Chronicon Scotorum, he freed all the slaves then residing in the city.
In 997, at a royal meeting near Clonfert, Máel Sechnaill met with his long-time rival Brian Boru, King of Munster. The two kings made a truce, by which Brian was granted rule over the southern half of Ireland, while Máel Sechnaill retained the northern half and high kingship. In honour of this arrangement, Máel Sechnaill handed over to Brian the hostages he had taken from Dublin and Leinster; and in 998, Brian handed over to Máel Sechnaill the hostages of Connacht. In the same year, Brian and Máel Sechnaill began co-operating against the Norse of Dublinfor the first time. Late in 999, however, the Leinstermen, historically hostile to domination by either the Uí Néill overkings or the King of Munster, allied themselves with the Norse of Dublin and revolted against Brian. The Annals of the Four Masters records that Brian and Máel Sechnaill united their forces, and according to the Annals of Ulster, they met the Leinster-Dublin army at Glenmama on Thursday, 30 December, 999. Glenmama, near Lyons Hill in Ardclough, County Kildare in AD 999 between Windmill Hill and Blackchurch. was the ancient stronghold of the Kings of Leinster. The Munster-Meath army defeated the Leinster-Dublin army. Ó Corráin refers to it as a "crushing defeat" of Leinster and Dublin, while The dictionary of English history says the battle effectively "quelled" the "desperate revolt" of Leinster and Dublin. Most importantly, the defeat left the road to Dublin "free and unimpeded for the victorious legions of Brian and Mael Sechlainn".
Overthrow and Restoration
The system of alternating succession between the various Uí Néill branches was ended by Brian Boru's so-called overthrow of Máel Sechnaill in 1002. In fact this was a bloodless shift resulting from the failure of the Northern Uí Néill, his kinsmen, to support Máel Sechnaill against the aspirations of the extremely militarized overlord of Munster. Brian would have little more success with them himself. Because of the death of Brian Boru, his son, grandson and many other Munster nobles at Clontarf in 1014, Máel Sechnaill succeeded in regaining the titular High Kingship, with the aid of his northern kinsman Flaithbertach Ua Néill, but the High Kingship, albeit with opposition, did not reappear until Diarmait mac Maíl na mBó of Leinster rose to power. Clann Cholmáin provided no further High Kings, but the northern Uí Néill of the Cenél nEógain provided two: Domnall Ua Lochlainn and Muirchertach Mac Lochlainn.