Kidwelly (Cydweli) is a town and community in Carmarthenshire, southwest Wales, approximately northwest of the most populous town in the county, Llanelli. In the 2001 census the community of Kidwelly returned a population of 3,289, increasing to 3,523 at the 2011 Census. It lies on the River Gwendraeth above Carmarthen Bay. The community includes Mynyddgarreg and Llangadog. The earliest written form of the name, 'Cetgueli', is recorded by the monk, Nennius, writing in the 9th century. One theory is that the name means the land, territory, or kingdom of Cadwal. Another theory is that the name is the combination of the two words Cyd (joint) and Gweli (bed), i.e., the joining of the two river beds Gwendraeth Fawr and Gwendraeth Fach, wherein Cydweli lies. The town itself is ancient and is shrouded in mystery of its founding, but the most popular theory is that it was founded by local warlords since the area was part of the Ystrad Tywi, it was likely invaded by Cunedda and his sons during a campaign to kick the Irish settlers out, but this ultimately failed with Cunedda either surrendering or being killed by the locals with antiquarian sources suggesting his death was at Allt Cunedda. The substantial and well preserved castle and church were established by the invading Normans in 1106. The earliest castle on the site was a typical Norman motte and bailey design that was made of earth and timber. The 13th century re-design was commissioned by Edward I Longshanks as a strategic part of his 'Ring of Steel' oppression against the Welsh. At the time of the stone castle's creation, Kidwelly benefited from the latest strategic military thinking in castle design. It had a concentric design with one circuit of defensive walls set within another to allow the castle to be held even if the outer wall should fall. The great gatehouse was begun late in the 14th century but it was not completed until 1422, somewhat due to the Welsh rebel Owain Glyndŵr’s efforts to reclaim Welsh independence.