De Montfort died at the Battle of Evesham in 1265, and the resulting English power vacuum allowed Llywelyn to consolidate his control of Welsh territory. He was formally recognised as Prince of Wales by Henry III with the signing of the Treaty of Montgomery on 29 September 1267.

When Henry was temporarily deposed by Baron Simon de Montfort after the Battle of Lewes in 1264, Llywelyn allied himself to the new ruler. The Treaty of Pipton, signed the following year, set out the terms Llywelyn had desired for several years: formal recognition as Prince of Wales and overlord of the other Welsh rulers.

Within two years, however, Llywelyn had gained control of the Perfeddwlad and most of the Pura Wallia - parts of Wales under native Welsh rule. By early 1258 he was using the title Prince of Wales, although the English crown refused to acknowledge him as such.

Llywelyn ap Gruffudd was well placed to succeed Dafydd, his uncle. In 1247 Llywelyn and his brother Owain signed the Treaty of Woodstock with King Henry III. The treaty restricted the brothers' rule to parts of Gwynedd west of the River Conwy, while the remainder of Conwy - the Perfeddwlad - remained under English control.

He was the grandson of Llywelyn ap Iorwerth, also known as Llywelyn Fawr (the Great), whose efforts to create a single Welsh principality ended with his death in 1240. Llywelyn Fawr was succeeded as ruler of Gwynedd by his younger son Dafydd ap Llywelyn, who died in 1246 without an heir.

Llywelyn ap Gruffudd (c.1223-1282), or Llywelyn the Last, was the last prince of an independent Wales. He died at the Battle of Orewin Bridge on 11 December 1282.

This was the peak of Llywelyn's power, and the only occasion on which an English ruler recognised the right of a ruler of Gwynedd over Wales. Henry ceded Builth, Brecon and Gwerthrynion to Llywelyn, granted him Whittington Castle in what is now Shropshire, and gave assurance that no castle would be built at Hawarden for 60 years, in return for payments totalling 25,000 marks (£16,667) over 10 years.

The fall of the house of Gwynedd

Henry died in 1272 and was succeeded by Edward I. Relations between the new king and the Welsh prince swiftly deteriorated, not least because of Llywelyn's continued alliance with the de Montfort family.

In 1276 Edward declared Llywelyn a rebel and the following year amassed an army to march on Conwy. Edward's men confiscated the substantial corn harvest in Anglesey, depriving Llywelyn's men of vital food supplies and forcing the Welsh prince to surrender.

This led to the Treaty of Aberconwy, which guaranteed peace but limited Llywelyn's power to the west of the River Conwy. Although he retained the title Prince of Wales, he was no longer the overlord of other Welsh rulers.

Although Llywelyn initially refused to acknowledge Edward as his sovereign ruler, he eventually paid homage to the king. In return Edward allowed Llywelyn to marry Eleanor de Montfort, who had been imprisoned in Windsor Castle. The pair married at Worcester Cathedral in 1278, and Eleanor became Princess of Wales and Lady of Snowdon.

Peace came to an end in 1282 when Llywelyn's brother Dafydd ap Gruffydd - a quick-tempered firebrand at the best of times - revolted against the English, capturing Hawarden Castle and murdering its garrison. The insurrection spread to other parts of Wales and, although Llywelyn was not immediately involved, he felt duty bound to support his brother.

Edward repeated his tactics of 1277, with his troops once again capturing Anglesey and large parts of Gwynedd. Edward offered Llywelyn a large English estate if he were to surrender Wales, while Dafydd was to be exiled on crusade and unable to return to Britain without the king's permission.

Llywelyn refused the offer, proclaiming that he would stand by the people whom his ancestors had watched over since "the days of Camber, son of Brutus." Camber, or Kamber, was the mythical first king of Cambria invented by the 12th century historian Geoffrey of Monmouth.

The Battle of Orewin Bridge

Llywelyn left Dafydd to defend Gwynedd, and took his men to mid and southern Wales to rally support. On 11 December 1282 his army - around 7,000 infantry and 160 cavalry - was positioned on a hillside near the village of Cilmeri, ready to fend off attacks from the south across Orewin Bridge.

The land was under the control of Marcher Lords, some of whom had pledged allegiance to Llywelyn. Three, however - Roger l'Estrange, John Giffard and Edmund Mortimer - were supporters of Edward, and had amassed an army of foot soldiers, archers and cavalrymen.

Llywelyn left his men; it is believed that he, and perhaps a group of retainers, went to speak to the Marcher Lords before fighting began. In the meantime, archers from the Marcher force crossed a ford around two miles from the bridge, allowing them to attack the Welsh army from another side.

As the Welsh turned to confront the archers they left the bridge undefended. The English seized the moment to attack. Mounted soldiers charged across Orewin Bridge, causing the leaderless and disorganised Welsh army to flee.

There are two versions of what happened next. The first has it that Llywelyn hurriedly returned to the battlefield, but was cut down by a lone lancer. The second is that Llywelyn and several members of his entourage were separated from the rest of his army and chased into a nearby wood, where he was surrounded and struck down.

As he lay dying, Llywelyn asked for a priest and revealed his identity. He was killed and his head was cut off. It was sent to Edward at Rhuddlan before being exhibited over the gate to the Tower of London.

As with the circumstances surrounding his death, Llywelyn's final resting place is unclear. His body may have been interred at the Cistercian Abbey at Abbeycwmhir, although his body is said to have been enclosed in a stone coffin on land where Llanrumney Hall was later built in Cardiff.

The death of Llywelyn ap Gruffudd marked the end of Wales as an independent principality. His appointed successor Dafydd continued fighting the English for several more months, but was captured in June 1283.

Dafydd was convicted of treason and condemned to death at a special parliamentary session held in Shrewsbury. On 3 October 1283 he was dragged through the streets of Shrewsbury. He was then hanged and disembowelled before his body was chopped into four pieces - a savage end to the Gwynedd dynasty.

Edward appropriated the historic, religious and regal artefacts of Gwynedd and took great delight in annexing the principality to the English crown. The majority of Llywelyn's relatives ended their days in captivity; his daughter Gwenllian was captured in 1283, and became a nun at Sempringham Priory in England before dying in 1337.