King Emrys III of Prydain, the last of the House of Dyfnaint, died childless in January 1078 without naming an heir. The most obvious candidate to succeed him was his brother-in-law, Gruffydd ap Culhwch, who came from one of the most powerful famlies in the realm. After gaining the support of other great nobles Gruffydd was crowned king on the royal hill of Ynys Wydryn on the 28th January.
However, his claim was disputed by his cousin, Hywel ap Cynan, who ruled across the sea in Arvor. Several years earlier, Gruffydd had been a guest at Hywel's court for a time, and it was alleged that he had sworn an oath to place Hywel upon the throne of Prydain. Whether or not this was true is unknown, but it gave Hywel a pretext to invade and seize the British crown by force.
Gruffydd mustered his army on the south coast in preparation for the invasion, but before it arrived he received news of an incursion across the northern border by Ebrauc. Leaving only a token force in the south, he rushed north to confront Ebrauc, but was defeated and killed in August at the Battle of Defa.
Landing and conquest of southern Prydain
Meanwhile, Hywel had finally landed in the south, and defeated the token force left behind at the Battle of Duwysg. He then marched east to overcome the hastily-raised peasant levies of Gadwfellwn at Sarwm, before finally marching on the capital city of Caerloyw. The city, which by now had heard of Gruffydd's death, surrendered to him without a fight, and Hywel entered in on the **th September to take his place as king.
After consolidating his power in Caerloyw for several weeks, Hywel continued onwards to subjugate the north. His passage across the Afon Hafren was blocked by the levies of Gwent and Powys, so instead he continued along its banks to try and shake them off. After several days, he suddenly turned away from the river in order to confront the remnants of Gruffydd's army at Caerlyr. The battle was a draw, though Gruffydd's army, led by his son Arthwr, suffered enough casualties that it had to retreat into Mercia rather than reclaim Prydain.
The Powysian levy, caught out by this unexpected move, found itself trapped on the wrong side of the river. It retreated into the chief Powysian city of Caer Guricon, where it endured a siege lasting several weeks before finally surrendering to Hywel.
Hywel then continued west to the Irish Sea. At Arfon he caught the last remaining Gruffydd loyalists, who had been hoping to find refuge on Ynys Mon, and destroyed them on the 8th December. He rested his army for the winter at Caernarfon and prepared for his next year's campaign.
Conquest of Ebrauc and Middle Anglia
In the spring he marched to confront Ebrauc, which still occupied much of northern Prydain. The Ebraucians fell back for a few days before making a stand at Eglwys, where they were soundly defeated. Hywel followed their retreat and crushed their remnants on the 5th April 1079 at Caer Iswrm, a short distance north of Caerbrauc, capturing their king. After entering Caerbrauc the next day, he announced the annexation of Ebrauc to Prydain.
Hywel now aimed to secure his eastern frontier by conquering the remnant Anglo-Frisian kingdoms of Lindsey and Mercia, which had been independent but under British hegemony for most of the last four hundred years. On the 20th April he crossed the Humber, quickly overcame Lindsey's small warband, and sacked its capital at Lincoln. King Eadfrith the Unlucky fled into exile in East Anglia.
A week later he pushed into Mercia and did likewise. However, its Queen Ælfflæd put up more of a fight than expected, personally fighting and killing several of Hywel's best men during the fall of Northampton. Driven into a black rage by this, he had Ælfflæd cruelly tortured and executed after her capture, an act which would leave its mark on Hywel and his descendents for generations to come.
Revolt of the Cawrtainians
While absent in the north, the people of Cawrtain and other nearby regions had been plotting with Arthwr ap Gruffydd to take back Prydain from the invaders. On the 2nd May they rose up in open revolt, hoping to encourage the rest of the country to do the same.
Hywel however subjugated Mercia sooner than expected, and came upon the rebels while they were still preparing. After catching them by surprise, he drove them back into the fortress of Caerlynt, which finally fell on the 19th May. Hywel showed no mercy, executing all the rebels and their famlies for treason. Arthwr escaped to Eriu, but two of his brothers were executed and his young sons were kept in prison for years.
This was the last serious opposition to Hywel's rule during his lifetime. His soldiers terrorised the countryside for a few years more, but the rest of his reign would prove to be relatively peaceful.
Hywel's conquest brought widespread changes to the culture and society of Prydain, most notably by introducing Islam as the new state religion. From Arvor, missionaries journeyed not just to Prydain but also to Lloegyr, England and Eriu, quickly converting the populace.
The old British ruling class was all but destroyed and replaced by friends and companions of Hywel. Some escaped abroad where they agitated against Hywel's regime, and this was one of the reasons for his successor's wars of conquest in Eriu and Lloegyr.