 Prior to Máel Sechnaill's coming to power, the southern Uí Néill had been disunited, and until Niall Caille defeated Feidlimid mac Crimthainn, king of Munster, at Mag nÓchtair (County Kildare) in 841, the midlands had been repeatedly ravaged by the Munstermen.At the same time, Ireland was a target for Viking raids, although these appear to have been of minor significance.Niall Caille apparently inflicted a heavy defeat on the Norsemen in 845 at Mag Itha shortly before Máel Sechnaill became king of Mide.