No archaeological excavation has been undertaken at Cefnllysmodern understanding of the site's history rests on contemporary texts. Prior to the 14th century, sources are limited to accounts of military campaigns and the castles are referenced in the Welsh chronicles
Brut y Tywysogion and
Annales Cambriae. Greater stability following Edward I's conquest of Wales resulted in a growth of documentary evidence in the Welsh Marches, though at Cefnllys this is largely restricted to rudimentary public records as the majority of the Mortimer estate archives have been lost. An extensive topographical survey combined with
photogrammetry was carried out at Castle Bank in 1985 by the
Royal Commission on the Ancient and Historical Monuments of Wales (RCAHMW), with a follow-up appraisal in 2006.
Hillfort origins A number of scholars have suggested that the medieval castles utilised the remains of an Iron Age hillfort. Indications of a pre-
Roman provenance include the ridge's large, elongated enclosure of , interpretation of visible earthworks and the extensive use of
scarping and
ditching to artificially steepen the gradient of slopes surrounding the hilltop. The archaeologist A. E. Brown tentatively linked the entrance
hollow-way with this period, and the banks encircling the hilltop could also have an Iron Age origin. Other features previously posited as pre-Roman were determined to be medieval by the 2006 RCAHMW report, although it did not rule out the possibility of a hillfort. The complexity of earthworks on Castle Bank is compounded by alterations caused by later agricultural use and quarrying, making confident assessment difficult. Among recent archaeological studies, Chris Martin & Robert Silvester(2011) state that the large bailey's Iron Age origins have been "convincingly argued", while Robert Scourfield & Richard Haslam(2013) surmise, on the basis of the RCAHMW report, that "the hill is no longer considered as having been first fortified in the Iron Age".
Initial medieval activity Cefnllys is connected in tradition with
Elystan Glodrydd, a 10th-century prince of
Buellt and founder of the regional Welsh dynasty. The court of a Welsh ruler is assumed to have been sited nearby, but the time period, duration and precise location of such a are unresolved. In a
Clwyd-Powys Archaeological Trust report for
Cadw, Robert Silvester observed that the motte-and-bailey north of Castle Bank is considered a probable site, granting that a in this setting is more likely to have superseded the Norman castle than predated it, and no physical traces have been found. A silver thumb-ring recovered on Castle Bank may date from an
early medieval period of Welsh occupation, and the circular graveyard ringed by yew trees could denote a pre-Norman origin of St Michael's Church. However, there is no substantive archaeological or written evidence to support any of these The timber motte-and-bailey north of Castle Bank is assumed to be the work of
Ralph Mortimer of Wigmore. One of a group of Norman barons who overran the region in 1093, Ralph is credited with the construction of a castle in Maelienydd named "Dynyetha", probably between 1093 and 1095. After his death , the area was retaken by the Welsh and remained a disputed territory throughout the 12th century. Dinieithon was last documented in 1179, but was not described as a castle, suggesting that it had been destroyed, abandoned or possibly reused as a . English control was still far from secure when
Llywelyn the Great, ruler of the ascendant Welsh state of
Gwynedd, established his authority over southern Powys between 1208 and 1216, acting as protector and
suzerain of the local Welsh dynasty. The historian Paul Remfry has speculated that the northern castle at Castle Bank may have been started in the period 1216–1234 under Llywelyn's direction, although it is generally considered to be a Mortimer creation.
First masonry castle The death of Llywelyn in April 1240 led to an internal power struggle within Gwynedd, presenting
Ralph Mortimer II with an opportunity to strengthen his position in Maelienydd. By the end of
Henry III's Welsh campaign of August 1241, Ralph was in full control of the cantref and had secured submissions from the local nobility. To consolidate these gains, Ralph ordered the "strengthening" of a "castle in Maelienydd" in 1242, which in his absence was undertaken in the name of his young son
Roger Mortimer. This work is identified with the north-eastern castle at Castle Bank; "strengthening" () may imply the reconstruction of an existing castle in stone, particularly as the establishment of a castle at Cefnllys is not explicitly recorded. Subsequent primary source references to Cefnllys describe it as the "new castle". Upon Ralph's death in 1246, Cefnllys Castle is listed in a
patent roll as passing into the custodianship of the crown until Roger's coming of age. Starting in 1256, a large Welsh uprising led by Llywelyn ap Gruffudd, the new prince of Gwynedd, caused an English military reversal across Wales. By the time a truce was signed in 1260, Cefnllys had become Roger's most advanced outpost following the loss of the neighbouring commote of Gwrtheyrnion and the castle at
Builth. In late November 1262, Cefnllys was seized from Roger's constable Hywel ap Meurig by a small band of Welshmen, who entered the castle "by treachery" and took Hywel and his family captive, before sending word to Llywelyn of their success and torching the castle. In response, Roger Mortimer levied an army of Marcher lords and arrived at Cefnllys to start repairs on the walls, but was caught off guard when Llywelyn surrounded him with a larger force. After a three-week siege within the damaged and unprovisioned castle, during which Llywelyn's soldiers sacked Roger's other castles at
Bleddfa and
Knucklas, Roger was forced to negotiate safe passage. Llywelyn allowed the Marcher force to retreat, a chivalrous gesture probably designed to strengthen his case at future peace negotiations, before destroying the remaining defences and continuing his campaign against England. The impact of Cefnllys' fall is illustrated in a letter written to Henry III by
Peter of Aigueblanche,
bishop of Hereford, as he fled for Gloucester: "Mortimer's castle of Cefnllys has capitulated: Roger and his retinue have left unharmed. All this has led to rumours of treachery and the whole March is in terror." The peace signed at the
Treaty of Montgomery in September 1267 was a major success for Llywelyn, granting him formal recognition as
Prince of Wales. Even though Cefnllys remained outside of his direct control and Roger Mortimer was permitted to rebuild the castle, Roger would provisionally hold the land on Llywelyn's behalf, as long as Llywelyn could demonstrate his right to it. Cefnllys, and the ambiguous clause regarding it, would become an imminent point of contention.
Second masonry castle Roger Mortimer moved quickly to refortify Castle Bank after the Treaty of Montgomery. The northern castle may have been repaired before the end of 1267, when Llywelyn wrote to Henry III complaining about the status of Cefnllys. Roger then started building a new, stronger castle on the southern side of the ridge, which Llywelyn, who interpreted the treaty as only permitting repairs to the existing castle, viewed as a provocation. Llywelyn sent a letter to Edward I on 22 July 1273 or 1274 protesting Roger's "new work", and requested that Edward prevent construction from continuing, lest he take action himself. The argument over Cefnllys was foremost among a series of territorial disputes between Llywelyn and the Marcher lords, which fed into a deteriorating climate of suspicion and distrust, further increased when Edward accepted defectors from Llywelyn's realm in 1274. The historian Robert Rees Davies wrote that Llywelyn, who also faced intense financial and domestic pressure, came to suspect "an orchestrated attempt to undermine his hard-won gains, especially in the middle March, and to subvert the terms of the Treaty of 1267". These grievances escalated into Llywelyn's refusal to pay homage to Edward I in 1275 and fuelled Edward's determination to pacify the insubordinate prince, culminating in Edward's subjugation of Wales between 1277 and 1283. Cefnllys was not directly attacked in the ensuing conflict but formed part of a chain of garrisoned castles encircling Llywelyn's territories, which contributed to the rebellion's suppression. Roger died in 1282 and his heir,
Edmund Mortimer, 2nd Baron Mortimer, paid for a garrison of eight horsemen and 20 footmen throughout the second phase of fighting (1282–3). In October 1294, Cefnllys was listed as one of the castles captured by "Rees ap Morgan" during
the revolt of
Madog ap Llywelyn, although the archaeologists David Browne & Alastair Pearson have expressed uncertainty over this account. In 1306, the castle passed into the hands of
Roger Mortimer, 1st Earl of March, who led an unsuccessful
rebellion against
Edward II which resulted in the confiscation of his holdings, including Cefnllys, in 1322. Roger returned from exile in 1326 and successfully overthrew Edward, briefly becoming
de facto ruler of England alongside
Queen Isabella, until he was executed in 1330 by
Edward III. Cefnllys was forfeited by the Mortimers as punishment but returned to the family the following year. Repairs of the castle and its hall were carried out from 1356 to 1357, and at the outbreak of the
Welsh uprising led by
Owain Glyndŵr in 1400, Cefnllys was in temporary royal custody. Records show that it was defended by a well-provisioned force of 12 spearmen and 30 archersa detailed register of supplies sent to the castle in 1403 survives. This may have been insufficient, as a 1405 grant to
Richard Grey described the lordship as "burned and wasted by the Welsh rebels", though it is unclear whether the castle itself was sacked or if the destruction was limited to its hinterland. The castle survived into the 15th century in a reparable state, but its upkeep was increasingly neglected as advances in warfare and shifting social patterns undermined its importance. The death of
Edmund Mortimer, 5th Earl of March, of plague in 1425 marked the end of the Mortimer male line and the castle was inherited by Edmund's nephew
Richard, Duke of York, who paid for repair work and appointed officials from a new class of Welsh office-holders to manage his distant estate. Throughout the Marches, minor Welsh nobles were rising to positions of local power, and they preferred the comfort of oak courts to draughty stone castles: in the view of historian Richard Suggett, change was "expressed architecturally by the decay of the masonry castles... and by the building of new timber halls at or near the castle sites by the Welshmen of influence within a lordship". The pre-eminent mid-15th century travelling poet
Lewys Glyn Cothi composed four poems regarding Cefnllys, including one which describes such a hall on Castle Bank. The poems, which survive in a manuscript from 1468 (although they probably date from 1432 to 1459), praise the Welshman Ieuan ap Phylip, who was constable of Cefnllys Castle and receiver of the lordship of Maelienydd. Ieuan had a two-storey hall built to exhibit his status and entertain guests, and, uniquely, Lewys' poetry records the name of the master carpenter as Rhosier ab Owain. The accession of Richard's son and heir,
Edward, to the English throne in 1461 caused Cefnllys to become crown property. It was included in a grant of predominantly ruined castles to
Prince Arthur by
Henry VII in 1493, and the antiquarian
John Leland recorded that the castle was "now downe" in the first half of the 16th century. The castle was described as ruins in a 1687 deed of sale. ==Castle town==