Dafydd ap Llywelyn died in 1246, without leaving an heir, and was succeeded by Llywelyn ap Gruffudd, his nephew. Edward I had inherited the English throne in 1272, and in 1276 declared Llywelyn a rebel. By 1277, Edward's armies had captured the Isle of Anglesey, and were encamped at Deganwy; the settlement, the Treaty of Aberconwy, forced Llywelyn to acknowledge Edward as his sovereign, and stripped him of much of his territory. Dafydd ap Gruffydd, Llywelyn's younger brother, attacked the English forces at Hawarden in 1282, setting off a widespread rebellion throughout Wales; Edward responded with a further invasion of Gwynedd, during which Llywelyn was killed on the battlefield at Cilmeri.