Caernarfon (; Welsh: [kaɨrˈnarvɔn] (listen)) is a royal town, community and port in Gwynedd, Wales, with a population of 9,852 (with Caeathro). It lies along the A487 road, on the eastern shore of the Menai Strait, opposite the Isle of Anglesey. The city of Bangor is 8.6 miles (13.8 km) to the north-east, while Snowdonia fringes Caernarfon to the east and south-east. Carnarvon and Caernarvon are Anglicised spellings that were superseded in 1926 and 1974 respectively.
Abundant natural resources in and around the Menai Strait enabled human habitation in prehistoric Britain. The Ordovices, a Celtic tribe, lived in the region during the period known as Roman Britain. The Roman fort Segontium was established around AD 80 to subjugate the Ordovices during the Roman conquest of Britain. The Romans occupied the region until the end of Roman rule in Britain in 382, after which Caernarfon became part of the Kingdom of Gwynedd. In the late 11th century, William the Conqueror ordered the construction of a motte-and-bailey castle at Caernarfon as part of the Norman invasion of Wales. He was unsuccessful, and Wales remained independent until around 1283.
In the 13th century, Llywelyn ap Gruffudd, ruler of Gwynedd, refused to pay homage to Edward I of England, prompting the English conquest of Gwynedd. This was followed by the construction of Caernarfon Castle, one of the largest and most imposing fortifications built by the English in Wales. In 1284, the English-style county of Caernarfonshire was established by the Statute of Rhuddlan; the same year, Caernarfon was made a borough, a county and market town, and the seat of English government in north Wales.The ascent of the House of Tudor to the throne of England eased hostilities with the English and resulted in Caernarfon Castle falling into a state of disrepair. The town has flourished, leading to its status as a major tourist centre and seat of Gwynedd Council, with a thriving harbour and marina. Caernarfon has expanded beyond its medieval walls and experienced heavy suburbanisation. The community of Caernarfon's population includes the highest percentage of Welsh-speaking citizens anywhere in Wales. The status of Royal Borough was granted by Queen Elizabeth II in 1963 and amended to Royal Town in 1974. The castle and town walls are part of a World Heritage Site described as the Castles and Town Walls of King Edward in Gwynedd.