Dún Bhun na Gaillimhe ("Fort at the Mouth of the Gaillimh") was constructed in 1124, by the King of Connacht Tairrdelbach mac Ruaidri Ua Conchobair (Turlough O Connor); the Annals of the Four Masters note that in that year "Three castles were erected by the Connaughtmen, the castle of Dun-Leodhar, the castle of the Gaillimh, and the castle of Cuil-maeile." This fort is also called a caislean "castle" in the annals. Its significance may date back even further, as the Danes of Limerick successively attacked the area in the 9th and 10th centuries, perhaps even making a seasonal camp in the area. At any rate Dún Bhun na Gaillimhe became the naval base of the Kings of Connacht and was attacked in this capacity in 1132 and 1149. Galway lay in the district of Clann Fearghaile which covered the parishes of St. Nicholas (the medieval city), Roscam and part of Baile an Chláir / Claregalway parish. This district was held by the Ó hAllmhuráin/O'Halloran] clan. Clann Fearghaile itself was a sub district of the tuath of Uí Bhriúin Seola the territory of which is called Maigh Seola ("plain of Seola"). The Ó Flaithbheartaigh clan held this tuath up until the Norman invasion of Connacht in the 1230s. As Dún Bhun na Gaillimhe lay in the territory of the O Flahertys they are often recorded as holding this fort for the O Connor Kings of Connacht.
Following an unsuccessful week-long siege in 1230, Dún Bhun na Gaillimhe was captured by Richard Mor de Burgh in 1232. Over the following century Galway thrived under the de Burghs (Burkes), becoming a small walled town. After the sundering of the de Burgh (Clanrickards) dynasty in 1333, Galway sought its independence from the feuding Clanrickard Burkes , receiving a murage charter (authority to build a defensive wall) from the Crown in 1396. The English oriented merchant families in the city were anxious to have control over their own affairs without the interference of the gaelicised Burkes in the plains to the east of the city. With independence from the Burkes achieved Galway became to large degree culturally and politically isolated from the surrounding Gaelic and Gaelic-Norman territories.

