The Castle of Dinerth (Welsh: Castell Dineirth, Castell Dinerth, or Castell Allt Craig Arth) is a Welsh castle located near Aberarth, Ceredigion, west Wales that was completed c. AD 1110. It is also known as Hero Castle, presumably from the Norse hiro ("king's carl").
The founder is thought to be one Richard de la Mare, a follower of Richard fitz Gilbert, Lord of Clare, an Anglo-Norman lord, who, by the archaeological evidence, built it on top of a previous defensive position. The castle was razed by Gruffydd ap Rhys but probably rebuilt, as it is known to have been destroyed again by Owain Gwynedd in 1136. The castle probably spent the next fifty years passing from one feudal ruler to another: from Hywel to Cadwaladr in 1144, and then ceded to Roger de Clare, 3rd Earl of Hertford in 1158, who garrisoned it. Destroyed by The Lord Rhys in 1164, it came into the possession of Maelgwn ap Rhys who lost it to, and recovered it from, his brother, Gruffudd ap Rhys. Maelgwn dismantled it to prevent his lands being held by Llywelyn the Great of Gwynedd. As Llywelyn then captured and held all the territory from the River Arth to the River Aeron, he conferred Dinerth on the sons of Maelgwn's brother Gruffudd as was rightfully due. The site was abandoned soon afterwards.
The ruins of the medieval timber castle can be found on a hill about 1½ miles up the valley from the seaside town of Aberarth. It occupies a strategic position at the confluence of the River Arth with the Erthyg Brook, with steep ravines on all sides except the east where there is a deep ditch backed by a bank. The whole site covers about three hectares and includes two mounds, which presumably supported towers, and a series of platforms to the south where it is likely the main buildings stood including the hall. The whole site is now covered by ancient oak and beech woodland which supports a varied flora.
The site's Welsh name (lit. "Fort Bear") and a passage in Gildas's work On the Ruin of Britain describing a receptaculi ursi (lit. "bear's lair" but equally "stronghold of the Bear") led some historians to suggest that the site might have a connection with King Arthur or his supposed court at Camelot. However, the site's name more likely derives from the nearby River Arth and the passage in Gildas, describing the "tyrant" King Cuneglas much more likely describes the Dark Age hillfort of Dinerth at Bryn Euryn above Llandrillo-yn-Rhos, his supposed kingdom.