Gofraid mac Arailt (died 989), in Old Norse Guðrøðr Haraldsson [ˈɡuðˌrøðz̠ ˈhɑrˌɑldsˌson], was a Scandinavian or Norse-Gael king. He and his brother Maccus were active in the lands around the Irish Sea in the 970s and 980s.
Gofraid and Maccus are usually assumed to be members of the Uí Ímair, a kin group tracing its descent from Ímar (died 873), sometimes identified with the saga-character Ivar the Boneless. Their father Aralt or Harald is usually identified with the Aralt mac Sitric, king of Norse-Gael Limerick, who was killed in Connacht in 940. This identification would make Maccus and Gofraid nephews of Amlaíb Cuarán, the King of Dublin. An alternative proposal, advanced by Benjamin Hudson, makes Gofraid and Maccus sons of a Viking chief named Harald who was active in Normandy, but this has received little support.
The first record of Gofraid is probably an attack on Anglesey in 971 by a son of Harald. The Brut y Tywysogion states that it was Gofraid who led this. The following year he collected tribute from Anglesey. He probably led a raid on Powys in 979, and in 980 was allied with Custennin ap Iago, and they again ravaged Anglesey, but Custennin was killed by Hywel ap Ieuaf. Chester was attacked in 980, the attackers perhaps led by Gofraid. In 982 he was again in Wales, this time in the southwest attacking Dyfed.
In 984, along with Maccus, he brought a fleet to Waterford, where they joined up with Brian Bóruma, king of Munster, and Ivar of Waterford, king of Waterford. Their combined armies and fleets attacked Dublin. An unnamed son of Harald won a battle on the Isle of Man in 987, but whether this was Maccus or Gofraid is unclear. Gofraid attacked Anglesey for the third time in 987, according to the Brut y Tywysogion, taking 2,000 captives.
Gofraid died in 989, said to be killed in Dál Riata, but whether this refers to the Glens of Antrim or perhaps to some part of the western coasts of Scotland is unclear. The notice of his death calls him king of Innse Gall, that is the Hebrides. Gofraid and Maccus are both usually included in lists of rulers of the Isle of Man.
Gofraid's son Ragnall died in Munster in 1005, and he too is called king of the Hebrides. Echmarcach mac Ragnaill may or may not have been Gofraid's grandson, as he is also contended to have been a grandchild or great-grandchild of Ivar of Waterford. The same is the case for Cacht ingen Ragnaill, queen of Donnchad mac Briain, often assumed to be Echmarcach's sister. The Banshenchas record that a daughter of one Gofraid named Máel Muire married Gilla Pátraic mac Donnchada, king of Osraige. If this is correct, Donnchad mac Gilla Pátraic, later King of Leinster, was this Gofraid's grandson, and all subsequent kings of Osraige and members of the FitzPatrick dynasty are their descendants. Although lacking a patronymic, scholars have identified him with Gofraid mac Arailt.
Lagmann, whom William of Jumièges calls "king of Swedes", probably an error for "king of the Sudreys", the Norse name for the Hebrides, is believed to have been a son of Gofraid. Lagmann's son Amlaíb is said by the Cogadh Gáedhel re Gallaibh to have been killed at the Battle of Clontarf and his genealogy is given there linking Lagmann and Gofraid.