Dublin is Ireland's oldest known settlement. It is also the largest and most populous urban centre in the country, a position it has held continuously since first rising to prominence in the 10th century (with the exception of a brief period in the late 19th and early 20th centuries when it was temporarily eclipsed by Belfast). The historic town grew up on the southern bank of the River Liffey, a few kilometres upstream from the river's outfall into Dublin Bay. The original settlement was situated on a ridge overlooking a shallow ford in the river, which had probably been a regular crossing-point since earliest times. The bedrock underlying the city is calp limestone, a dark shaly sedimentary rock which was once quarried locally and whose mottled grey appearance can still be seen today in some of the city's oldest buildings. Overlying this is a layer of much looser boulder clay of varying thickness.

It is no accident that Dublin became the principal city in Ireland. It is located on the island's only significant coastal plain, which not only forms a natural gateway to the rest of the country but also looks out towards the country's closest and most influential neighbour, Great Britain. Furthermore, Dublin Bay provided early settlers with a substantial and easily defended harbour, protected to some extent by treacherous sandbanks, shallows and mudflats, and overlooked by the twin sentinels of Howth Head and Killiney Hill.

Early history The first known inhabitants of the Dublin region were hunter-gatherers living during the Later Mesolithic, or Middle Stone Age, around 5500 BC. Shell middens, fish traps and occupation debris, which have been found at a number of locations on and around the shores of Dublin Bay (most notably at Sutton, on Dalkey Island), at the Diageo site at Victoria Quay and at Spencer Dock, which is situated along the northern quays, near the mouth of the River Liffey, indicate that these early settlers lived off the sea.

The first farmers appeared in the Neolithic, or New Stone Age, shortly after 4000 BC. These were the first to erect megalithic monuments and evidence of their culture survives in the burial cairns, passage tombs, portal tombs and wedge tombs that can still be seen in the Dublin Mountains and on the coastal lowlands just to the south of the modern city. Stone axes made of porcellanite from County Antrim or porphyry from Lambay Island have also been discovered at a number of sites in the Dublin region. Pottery too was first manufactured in Ireland during the Neolithic, one of the most noteworthy finds being a funerary bowl which was found in a burial site at Drimnagh, County Dublin.

Around 2400 BC metal working made its first appearance in Ireland. Archaeological excavations in Suffolk Street have uncovered prehistoric copper axe-heads – the copper axe being the principal metal artifact during the earliest phase of Irish metallurgy (the so-called Knocknagur Phase, or Copper Age, which lasted from 2400 to 2200 BC).

The Bronze Age, which in Ireland is dated from 2200 to 600 BC, also left its mark on the Dublin region. A variety of bronze and gold artifacts which have been discovered in the vicinity of the modern city – among them cauldrons, side-blown horns, lock rings, sleeve fasteners, striated rings, hair rings and penannular bracelets – indicate a continuous or intermittent settlement of the area.

In Ireland the commencement of the Iron Age around 600 BC is generally believed to coincide with the first appearance in this country of Celtic-speaking peoples. There is little archaeological evidence to support the theory of a large-scale Celtic invasion (or series of invasions), but it is quite possible that small groups of migrants, highly skilled in the art of war and armed with superior iron weaponry, were powerful enough to gain a foothold in the island and eventually succeeded in subjugating or absorbing the pre-Celtic natives; in the 12th century small bands of heavily armed Anglo-Normans did just this, so there is no conceivable reason why it could not also have happened in the pre-Christian era.

Iron ores are widely distributed throughout Ireland – one of the country's two richest deposits is to be found in County Wicklow, just a few days' walk from the Dublin region – but there is little archaeological evidence for an urban settlement on the site of the modern city during the Early Iron Age (or Athlone phase). Excavations at various locations in the region, however, do indicate intermittent occupation at scattered locations throughout this period (e.g. at Taylor's Grange in Rathfarnham, and at Cherrywood near Loughlinstown).

Once associated with the Iron Age is the ringfort, or ráth, a defensive formation generally consisting of one or more circular earthen embankments surrounded by a ditch. The existence of ringforts in the Dublin region may be deduced from the names of several of the modern city's suburbs: Rathmines, Rathgar, Rathfarnham (on the south side of the city) and Raheny (on the north side). There is also the village of Rathcoole, which lies to the southwest of the modern city. Needless to say the growth of the modern city has all but obliterated these structures, but excavation of ringforts in other parts of the country has sometimes revealed traces of earlier, pre-ringfort occupation of the same sites. In the Dublin hinterland, surviving ringforts are too numerous to mention individually, though a univallate ringfort at Rathmichael (near Shankill to the southeast of the city) may be noted. The lowlying area to the northwest of the city is particularly rich in ringforts. It is now thought, however, that most of Ireland's ringforts date from the Christian era.

Pre-Viking Dublin

Although the site of the modern city of Dublin has been occupied intermittently since the Mesolithic era, it is not known when the first permanent settlement was established. Ptolemy's description of Ireland, which was compiled around 140 AD but which may draw on much earlier accounts, was once thought to contain a reference to Dublin in Eblana, the name of a settlement on the east coast; this, however, is no longer thought likely and the similarity of the two names is probably coincidental.

Early Dublin is also referred to in a number of native sources. The Book of Invasions, a largely fabulous compilation of myths and legends, mentions Dublin when describing how two legendary kings of Ireland, Conn of the Hundred Battles and Mug Nuadat, divided the country between them. The line of demarcation, which cut the island into two symbolic halves (known as Leth Cuinn, or "Conn's Half", and Leth Moga, or "Mug's Half") ran along the Esker Riada from High Street in Dublin to Galway on the west coast. According to another work which draws on early sources, the Annals of the Four Masters, Fiachu Sraibtine, the king of Tara, quelled the rebellious inhabitants of Leinster in a battle fought at Dublin in 291 AD; the Annals of Dublin also record that Alphin mac Eochaid, King of Dublin, was converted to Christianity by Saint Patrick in 448 AD. But these entries were only added to the Annals, or the sources from which they were compiled, many centuries after the events they purport to record, and no reliance can be placed on them. The simple fact is that we do not know for certain when the city of Dublin was founded.

When contemporary records begin in the 5th century, there is a thriving community of farmers and fishermen in existence in the vicinity of Cornmarket and High Street. A ringed pattern of streets and laneways which can still be discerned in this part of the modern city may be a relic of the original boundary of an early settlement. Located on a prominent ridge overlooking the River Liffey (previously known as the Ruirthech, "running swiftly"), this settlement was easily defended and ideally situated to take advantage of the ford, which lay just 100 metres away.

The name ford of hurdles – Áth Cliath in Irish – suggests that, to facilitate travellers who wished to cross the river dry-shod during low tide, the inhabitants of this settlement constructed a lattice-work of interlaced osiers – hurdles – and secured it to the muddy bed of the river, perhaps making use of the fortuitously placed Usher's Island in the middle of the stream. It is also possible that a series of hurdles used as fish-traps were placed along the banks of the river. The hurdles were probably located about 100 metres west of the point where Father Mathew Bridge now crosses the Liffey, but in the absence of archaeological evidence both its nature and precise location must remain matters of speculation.

In ancient times the lower course of the Liffey is believed to have formed part of the boundary between the provinces, or overkingdoms, of Leinster and Mide (though there is some conflicting evidence which suggests that the boundary was actually marked by another river, the Tolka, which now discharges into Dublin Bay about a kilometre north of the Liffey). Áth Cliath, which belonged to Leinster, must have been an important trading place thanks to its strategic location on this political boundary.

Early roads It is also hardly a coincidence that four of the five great highways, or of ancient Ireland converged on the site of the medieval city, and not on Tara, as early Irish historians spuriously claimed:Slige Midluachra – this road ran southeast from Ulster, and passed through Tara, the seat of the High Kings of Ireland in County Meath. It crossed the Liffey at the ford of hurdles, and came to an end just south of Áth Cliath. Parts of the Slige Midluachra may still be made out in some of Dublin's modern streets: e.g. Bow Street on the north side of the city, and St Augustine Street and Francis Street on the south side.Slige Mhór – this was the "great highway" that ran from east to west across the entire country, dividing it into two symbolic halves (Leth Cuinn and Leth Moga). Its eastern terminus lay just beyond Áth Cliath. In the modern city, James's Street and Thomas Street still follow its course.Slige Chualann – this road ran south from Áth Cliath. It took its name from Cualu, the district in which Dublin was situated and which lay between the mouths of the Liffey and the Avoca (in County Wicklow). Long stretches of the Slige Chualann survive to this day. In the modern city its early course is followed by New Street, Clanbrassil Street, Harold's Cross Road and Terenure Road North, it then carries on past Rathfarnham Castle, returns to its original mountain tract beyond Marlay Park, today known as The Wicklow Way, a long-distance trail inaugurated in 1980, follows much of the course of Slige Chualann.Slige Dála – the fourth great highway was the "highway of the assemblies". It approached Áth Cliath from the southwest, following the course of the Commons' Water, a small tributary of the river Poddle, which in turn is a tributary of the Liffey. Its terminus was at the southern end of the ecclesiastical settlement of Dubhlinn (see below). It survives today in Cork Street, Ardee Street and The Coombe.

These four highways linked Dublin with the five provinces of ancient Ireland: Ulster and Mide to the north, Connacht to the west, Munster to the southwest and Leinster to the south. Although it is not known when these roads were first constructed, a tract dating from around 700 testifies to their early existence. A fifth, unnamed road may have linked Áth Cliath with Tara, County Meath, the seat of the High Kings of Ireland. It is possible that traces of this road are preserved in the modern thoroughfare that runs northwest from Stoneybatter (i.e. the Stoney bóthar, or "cow-track") through Ratoath Road in the general direction of Tara. The existence of this unnamed road suggests that the Slige Midluachra originally by-passed Tara, running north from Dublin to Emain Macha.