 King Cynan Dindaethwy maintained his royal court () in the town around the turn of the 9th century, but he was killed amid a protracted struggle against a rival named Hywel.Following Cynan's death, there was a major Battle of Llanmaes () recorded in all the Welsh annals.Various sources conjecture that the battle marked an invasion by Mercians, Wessaxons, or Vikings, but the original sources simply do not record the combatants.