 In 1202 Madoc ap Gruffydd Maelor, Lord of Dinas Brân, granted some of his demesne lands in ‘Wrechcessham’ to his newly founded Cistercian abbey of Valle Crucis and in 1220 the earliest reference to a church in Wrexham is made.Following the loss of Welsh independence on the death of Llywelyn ap Gruffudd in 1282, Wrexham became part of the semi-independent Marcher lordship of Bromfield and Yale.Wrexham increased in importance throughout the Middle Ages as the lordship's administrative centre, and the town's position made it a suitable centre for the exchange of the produce of the Dee valley and Denbighshire uplands, whilst iron and lead were also mined locally.