The origins of the city date back to the founding of a monastic establishment on the site of Bangor Cathedral by the Celtic saint Deiniol in the early 6th century AD. 'Bangor' itself is an old Welsh word for a wattled enclosure, such as the one that originally surrounded the cathedral site. The present cathedral is a somewhat more recent building and has been extensively modified throughout the centuries. While the building itself is not the oldest, and certainly not the biggest, the bishopric of Bangor is one of the oldest in the UK.
In 973, Iago, ruler of the Kingdom of Gwynedd, was usurped by Hywel, and requested help from Edgar, King of England, to restore his position. Edgar, with an army went to Bangor, and encouraged both Iago and Hywel to share the leadership of the realm. Asserting overall control however, Edgar confirmed liberties and endowments of the Bishop of Bangor, granting land and gifts. From 1284 until the 15th century, Bangor bishops were granted several charters permitting them to hold fairs and govern the settlement, later ones also confirming them as Lord of the Manor.
Bangor remained a small settlement until the start of the 18th century, when a political desire to enhance communications between England and Ireland via the London-Holyhead-Dublin corridor saw it designated as a post town in 1718. Growth was spurred by slate mining at nearby Bethesda, beginning in the 1770s by Richard Pennant, becoming one of the largest slate quarries in the world. The route between London and Holyhead was much improved by Thomas Telford building the A5 road, which runs through the centre of the city and over the Menai Suspension Bridge which was also completed by him in 1826. Bangor railway station opened in 1848.
A parliamentary borough was created in 1832 for Bangor, becoming a contributing Caernarfon out borough as its status grew due to further industry such as shipbuilding as well as travel, not just from Telford's road, but through tourism mainly from Liverpool via steamboat. It was also an ancient borough from earlier privileges granted to Bangor in medieval times, but an 1835 government report investigating municipal corporations concluded that this status was defunct and in name only. The borough was reformed in 1883 into a municipal borough.
Friars School was founded as a free grammar school in 1557, and the University College of North Wales (later Bangor University) was founded in 1884. In 1877, the former HMS Clio became a school ship, moored on the Menai Strait at Bangor, and had 260 pupils. Closed after the end of hostilities of World War I, she was sold for scrap and broken up in 1919.
In World War II, parts of the BBC evacuated to Bangor during the worst of the Blitz. The BBC continue to maintain facilities in the city (see Media).
In 2012, Bangor was the first ever city in the UK to impose, throughout its city centre, a night-time curfew on under-16s. The six-month trial was brought in by Gwynedd Council and North Wales police, but opposed by civil rights groups.
In 2021, Owen Hurcum was unanimously elected as mayor, making history as the youngest-ever mayor in Wales at 22, as well as the first ever non-binary mayor of any UK city.