Caernarfon Castle is a medieval fortress in Caernarfon, Gwynedd, north-west Wales cared for by Cadw, the Welsh Government's historic environment service. There was a motte-and-bailey castle in the town of Caernarfon from the late 11th century until 1283 when King Edward I of England began replacing it with the current stone structure. The Edwardian town and castle acted as the administrative centre of north Wales and as a result the defences were built on a grand scale. There was a deliberate link with Caernarfon's Roman past – nearby is the Roman fort of Segontium – and the castle's walls are reminiscent of the Walls of Constantinople. While the castle was under construction, town walls were built around Caernarfon. The work cost between £20,000 and £25,000 from the start until the end of work in 1330. Despite Caernarfon Castle's external appearance of being mostly complete, the interior buildings no longer survive and many of the building plans were never finished. The town and castle were sacked in 1294 when Madog ap Llywelyn led a rebellion against the English. Caernarfon was recaptured the following year. During the Glyndŵr Rising of 1400–1415, the castle was besieged. When the Tudor dynasty ascended to the English throne in 1485, tensions between the Welsh and English began to diminish and castles were considered less important. As a result, Caernarfon Castle was allowed to fall into a state of disrepair.