Penllyn (head of the lake i.e. Bala Lake or Llyn Tegid) was a medieval cantref originally in the Kingdom of Powys but annexed to the Kingdom of Gwynedd. It consisted of the commotes (cymydau) of Edeyrnion, Dinmael, Penllyn is Treweryn and Penllyn uwch Treweryn (is signifying 'below' and uwch 'above' the River Tryweryn).
After the death of Madog ap Maredudd, the last Prince of the whole of Powys, and his eldest son and heir in 1160, the kingdom was divided between his surviving sons Gruffydd Maelor, Owain Fychan and Owain Brogyntyn, his nephew Owain Cyfeiliog and his half-brother Iorwerth Goch. Penllyn was inherited by Owain Brogyntyn; Edeyrnion had been the home of his mother (who was not married to his father) and he may also have been raised there.
The military skill and strength of Madog had prevented Gwynedd from asserting hegemony over Powys, but following Madog's death, it was able to force Owain Brogyntyn to become a vassal. Penllyn was thus annexed to Gwynedd.