The castle passed between various owners in the first half of the 14th century, before coming under the control of the Mortimer family. Meanwhile, the walled town had proved impractical to live in, and a newer, much larger, settlement developed outside the defences. In 1400, the walled town was raided during the Glyndŵr Rising, although the castle itself remained secure throughout the rebellion. During the Wars of the Roses, Denbigh was attacked by Lancastrian forces; the walled town was attacked and burnt. In the aftermath, the old town was largely abandoned by its inhabitants, the walled area becoming an extension of the castle's defences.
During the English Civil War, Denbigh was held by the Royalists until it was taken in 1646 following a Parliamentary siege. The castle was seized by Royalist soldiers in 1659, after which General George Monk ordered it to be slighted, with various parts of the walls and towers being demolished. The site deteriorated further over the years and the old walled town remained almost deserted. In the middle of the 19th century, the town created a committee to manage the ruins and carried out restoration work. The central government's Office of Works took over responsibility for the fortifications in 1914, with the site ultimately passing into the control of the Welsh Cadw heritage agency.
Denbigh Castle is dominated by a triangle of three octagonal towers that forms its main entrance, considered by the historian John Goodall to be "the most architecturally sophisticated gatehouse of the thirteenth century". Eight mural towers protect the rest of its curtain wall, further protected by barbicans and a mantlet of defensive terraces and walls. The castle connects to the town walls, which remain largely intact and stretch for around 1,100 metres (3,600 ft) around the old town. The town walls were once protected by four towers and two gatehouses, although only one of the gatehouses still survives. The castle and town's gatehouse were constructed of decorative stonework, intended to symbolise royal authority and civic pride.
Denbigh Castle was constructed within what was originally the Welsh patrimony of Perfeddwlad. The patrimony controlled the pastoral farming lands on the Denbigh Moors and formed a royal residence, llys, for the Welsh princes. Perfeddwlad was strategically located along the Welsh border but its ownership was disputed and the territory was fought over by the Normans and Welsh many times during the 11th and 12th centuries.
In 1277, the Welsh prince Dafydd ap Gruffudd was granted Perfeddwlad by the English king, Edward I, who at the time was allied with Dafydd in his struggle against his brother Prince Llywelyn. Dafydd rebuilt the existing residence, creating a substantial castle. It is uncertain what form it took or exactly where on the current castle site it was located, but it included a bakehouse, buttery, chapel and a hall, and it became Dafydd's main stronghold. The Welsh called the settlement Dinbych, an abbreviation of Dinas Fechan, meaning "little fortress".