, Prince of Gwynedd's main land holdings lay in the Gwynedd. In order to assert his claim to be the most important of the Welsh princes he felt the need to exercise his authority in the strategic area which is the Severn Valley, giving as it does access to the heartlands of Wales. In 1257 he invaded the area so that by 1263 he had captured the districts known as Cedewain and Ceri. As a result of this Henry III recognised Llywelyn as Prince of Wales under the terms of the Treaty of Montgomery of 19 September 1267. In order to consolidate his newly conquered lands and to affirm his control Llywelyn ap Gruffydd constructed the castle at Dolforwyn between 1273 and 1277 for a recorded cost of £174 6s 8d. The castle was fairly primitive in its concept compared to some structures to be found elsewhere. A rectangular platform was hewn from the rock some 240 feet by 90 feet and the initial castle consisted of a rectangular keep at the south west end of the platform and a circular tower at the opposite end. The two structures were subsequently connected by ramparts to make a rectangular shaped enclosure with a D-shaped tower on the northern wall. The enclosed area was divided into two wards by a rock-cut ditch. A two-storey structure was built against the north wall. The main gateway into the castle was in the west wall. A smaller entrance was sited in the south wall.
Capture
Following the construction of the castle without the authorisation of the new English kingEdward I, whose frontier post was at Montgomery Castle, tensions grew between him, Llywelyn ap Gruffydd, and Gruffydd ap Gwenwynwyn Prince of Southern Powys, who held Powis Castle at nearby Welshpool. In 1277 shortly after the castle had been completed Roger Mortimer and Henry de Lacy, Earl of Lincoln besieged it. It fell on 8 April 1277 because a well had not been constructed and the occupants ran out of water. Custody was firstly given to Gruffydd ap Gwenwynwyn but subsequently to Roger Mortimer along with the lands of Ceri and Cedewain. Following its fall, the castle design was modified by its new English overlords. The south gate was blocked, new buildings were set up in the courtyard, and a well was dug. Following the death of Roger Mortimer in 1282, the castle passed to his son Edmund Mortimer, then to his son, Roger Mortimer, 1st Earl of March, who lost the family estates in 1322 after an act of treason. An inventory taken at the time recites the rooms, which included an armoury in the round tower as well as domestic ranges with a pantry, buttery, kitchen, brewhouse, bakehouse, chapel, hall, a lady's chamber and two granges for the storage of grain.
Later years
Dolforwyn appears to have been occupied until the reign of Richard II, but by 1381 it was already described as being in poor repair, and in 1398 it was described as being "ruinous and worth nothing." It appears that after this date the castle was almost lost from memory and attracted little interest. The ownership of the castle passed to the Earls of Powis and was subsequently bought by the grandfather of the antiquarian John Davies Knatchbull Lloyd, who gave the site to the Welsh Ancient Monuments Board in 1955. Cadw arranged for excavation of the site between 1981 and 2002 and the monument is now open to the public. In June 2009 Cadw commenced a 6-month process of consolidation of the castle masonry.
The entire site of Dolforwyn Castle was archaeologically excavated between 1981 and 2002 as a joint project between the University of Leeds and University of York 1986- 2002. and Cadw. Over the course of three decades, students and Cadw employees spent three or four weeks each summer examining specific parts of the castle. The work was under the directorship of Dr Lawrence Butler. The site was also rendered by a team of local masons employed by Cadw. Finds from these excavations included part of a leather book cover, a small die, a silver coin from the reign of Edward II and a large array of spent stone catapult balls from the English siege of 1277. In the course of the excavations, more than of debris and infill was removed to reach the castle's features. These included a small stone lined hall, English repairs to Welsh masonry, a suspected wheat-drying oven and a cistern/cellar well.