O'Melaghlin (Ó Máel Shechlainn), Cormac (c.1175–1239), a leading dynast, was probably the eldest son of Art O'Melaghlin (c.1145–1184), king of west Meath, who had exploited the arrival of the English to overcome his dynastic rivals and seized the kingship by the mid-1170s. His lands were the target of the drive for territory by the colonists, and he defended them against the settlers and Hugh de Lacy (qv) (d. 1186), lord of Meath. His hostility led to a plot to assassinate him in which the English enlisted the help of Diarmait son of Toirdelbach O'Brien (Ó Briain) of Ormond; in the course of an assembly of the O'Melaghlins at Drumcullen, Co. Offaly, in 1184, O'Brien sought a private audience with Art and, when he had separated him from his kinsmen, stabbed him to death.
Cormac and his brothers must have been mere boys at this time and the kingship was claimed by Maelsechlainn Bec O'Melaghlin (Art's half-brother); he took up the struggle against the English with the help of Conchobar Máenmaige Ua Conchobair (qv) (O'Connor) (d. 1189), king of Connacht, whose lifelong aim was to preserve the O'Connor overlordship east of the Shannon by destroying the English castles that guarded the passes and fords of west Leinster and the midlands. In 1184 Conchobar Maenmaige and Maelsechlainn Bec razed castles in west Meath. The assassination of de Lacy in 1186 by the Irish during his inspection of Durrow castle offered Conchobar Maenmaige an opportunity to capitalise on anti-settler feeling among the Irish of the midlands: between 1185 and 1189 Maelsechlainn Bec and other notable Irish kings, including Domnall Mór Ua Briain (qv) (O'Brien) (d. 1194), king of Thomond, Domnall Mór Mac Cárthaig (qv) (d. 1206), king of Desmond, Ruaidri MacDunleavy (Mac Duínn Sléibe) (d. 1201), king of Ulaid, and Aed O'Rourke (Ó Ruairc) of Breifne, pledged their vassalage to Conchobar Maenmaige. Maelsechlainn Bec and his overlord collaborated again in 1187 when they destroyed Killare castle in west Meath.
After the assassination of Conchobar Maenmaige in 1189, Maelsechlainn Bec moderated his attitude to the English and became generally compliant; by 1205 his power was declining and Cormac and his brothers had emerged as a potent regional force, deploying skilful usage of terrain and English military techniques to wage an unrelenting war of attrition on the settlers. Cormac's rise among the midland Irish was facilitated by the disintegration of O'Connor influence in the region during the reign of Cathal Crobderg Ua Conchobair (qv) (d. 1224), king of Connacht, and by the advance of English royal jurisdiction. In 1206 Cormac attacked the English town of Ballyloughloe in west Meath and defeated Maelsechlainn Bec and his English allies. As the decade progressed Cormac's uncompromising hostility to the English made him a legend among the Irish. In 1208, when Art O'Rourke enlisted English help to depose Ualgarc O'Rourke (qv) (d. 1231), king of west Breifne, Cormac gave refuge to Ualgarc and in the following year restored him to his kingdom after killing Art in single combat.
A major reason for Cormac's success was the vulnerability of the settlers along the long frontier of English Leinster, where they were exposed to the threats and influences of resurgent rulers in the still unconquered lands in Connacht, Munster, and Ulster. But the humiliation of Connacht under Cathal Crobderg made the Irish leaders look weak, while the erection of the castles of Athlone, Clones, and ‘Cael Uisce’ near Belleek and the advance of common law gave the English the impetus to conquer Connacht and the midlands. With no prospect of military aid from their overlords, the junior O'Brien, O'Melaghlin, and O'Connor branches looked to Cormac, the most powerful midland lord, for support. In 1211 he and his brother Maelsechlainn attacked the settlers, forcing the justiciar, John de Grey (qv), bishop of Norwich, to call up reinforcements from Donnchad Cairprech O'Brien (qv) (d. 1242) of Thomond and the English of Munster.
In 1212 Irish attacks upon the castles intensified. With the help of an O'Connor army, Grey strengthened Cael Uisce castle, and to the east the building of Clones castle continued despite attacks from Niall MacMahon and Aed Méith O'Neill (qv) (d. 1230). Then, in an offensive coordinated by O'Neill, the English of Ulster were plundered and Cael Uisce and Clones castles were destroyed; another English force, sent into west Meath to crush the Irish, was annihilated, at Kilnagcrann Ford, by Cormac, the MacCoghlans, and the sons of Conchobar Maenmaige. Cormac's victories and determination to extend his power may have frightened his Irish neighbours, for later that year his cousin, Domnall Bregach O'Melaghlin, rose against him and with a group of allies, including Cuilén O'Dempsey (Ó Dimusaig), Muirchertach O'Brien of Ormond and Domnall Clannach MacGillapatrick (Mac Gilla Pátraic) of North Ossory, defeated him; Domnall's triumph was short-lived, for Meiler de Bermingham killed him soon afterwards. Cormac rallied his forces and routed the English yet again at Kilnagcrann Ford, which inspired Muirchertach O'Brien of Ormond to turn on the English of Ely and Ormond, destroying five of their castles. In autumn 1212 the new justiciar, Henry of London (qv) (d. 1228), archbishop of Dublin, proclaimed a royal service at Roscrea, from where he marched into Offaly, defeating Muirchertach O'Brien and Máelsechlainn O'Connor at Killeigh.
In 1213 the English now concentrated on the destruction of Cormac, who was the main threat to their plans for the plantation of the midlands. While the English of Ulster, Leinster, Meath, and Munster were gathering at west Meath, Cormac attacked Ardnurcher and Kinclare castles, but his opponents converged on him and defeated him at the River Brosna, forcing him to flee, probably to Connacht. Among the fallen was Ruaidri O'Keary (Ó Ciarda), and the later hanging of two O'Dempsey leaders in 1213 at Dublin suggests that they also fought for Cormac. A chain of castles, including Clonmacnoise, Birr, Durrow, and Kinnity, was quickly erected to guard against Cormac's return. When he had regrouped he destroyed as many castles as he could, burning Kinclare, Athboy, and Smerhie, damaging Birr, and forcing Maelsechlainn Bec O'Melaghlin to flee from Delvin. With Maelsechlainn Bec gone, Cormac assumed the lordship of Delvin. He seems shortly afterwards to have come to a peace with the English (perhaps through the mediation of Cathal Crobderg O'Connor), as is further suggested by the fact that in 1214 the O'Melaghlins in arms were led by Maelsechlainn Óg O'Melaghlin (Cormac's rival) and an un-named O'Connor Faly (Ó Conchobair Failge) lord. Cormac regained his former prominence only years later.
Throughout the wars of the Connacht succession (1225–37) Cormac loyally supported the sons of Cathal Crobderg. In May 1227 Richard de Burgh (qv) and the sons of Ruaidrí Ua Conchobair (qv) (O'Connor) (d. 1198) invaded Connacht and expelled its king, Aed son of Cathal O'Connor (d. 1228), creating considerable unrest among the Irish dynasties of the midlands, where the English supporters of the sons of Ruaidri tried to weaken the allies of Aed in Meath and Leinster. They attacked the monastery of Clonmacnoise, the emblem of the Connacht kingship, and captured Cormac, his wife, foster-father, and steward, who were staying there, holding them to ransom for a large sum in gold. When Aed O'Connor was murdered in Leinster in 1228, Cormac transferred his loyalty to his brother Feidlimid O'Connor (qv) (d. 1265), who in 1230 became king of Connacht after de Burgh deposed Aed O'Connor (qv) (d. 1233). In 1234 Feidlimid invaded west Meath to exploit the unrest caused by the struggle between Richard Marshal (qv) (d. 1234), 3rd earl of Pembroke and Striguil, and Henry III; Cormac may have joined him to burn the English towns of Ardnurcher and Ballyloughloe, and thereafter the two men's fortunes were intertwined. In summer 1235 Burke defeated Feidlimid and Donnchad Cairprech O'Brien of Thomond in a pitched battle, forcing Feidlimid into exile in Donegal and exposing Cormac to a direct assault from the English. Shortly afterwards, Cormac was again taken captive, this time by the justiciar, Maurice FitzGerald (qv) (d. 1257), at Athlone; he probably owed his freedom, after a brief confinement, to the submission of Feidlimid before FitzGerald. The tensions between Feidlimid and Burke reemerged later in the year, and early in 1236 a plot against Feidlimid led to his fleeing again to the safety of Donegal. In his absence FitzGerald granted the kingship to Brian son of Toirdelbach O'Connor (d. 1267), a descendant of Ruaidrí, but Cormac and a strong party of the Connacht nobility worked for the return of Feidlimid. Later in 1236 Feidlimid and his kinsmen returned from Donegal, and with Cormac and the O'Kellys, burned Rinndown castle in Roscommon and routed Brian; by late 1236 or early 1237 Feidlimid had reestablished himself and made peace with Burke.
This proved to be Cormac's last campaign. In 1239 this most formidable of Irish enemies of the English settlers in the midlands died quietly on the Connacht island of Inisdowginn on the Suck, leaving two sons, Diarmait Ruad O'Melaghlin (d. 1249) and Art O'Melaghlin (d. 1283).