Early references
One of the earliest, if not the earliest, Welsh literary references to Arthur is in the poem Y Gododdin, attributed to the Cynfeirdd poet Aneirin.
In the poem the mythical Arthur is held in higher esteem than a valiant warrior of the Gododdin tribe who was involved in the battle of Catraeth. The warrior named Gwawrddur is praised highly by Aneirin, but Arthur's stature appears to overshadow the valiant Gwawrddur as the poem states 'though he was not Arthur'.
The earliest datable reference to Arthur in Welsh literature is believed to be in The Historia Brittonum (c.829-30), as he is referred to as 'a leader of battles' ('dux bellorum'), having fought at 12 battles. Arthur's battle-hero persona is also mentioned in early poem Marwnad Cynddylan - an elegy for a king of Powys named Cynddylan ap Cyndrwyn featured in the Canu Heledd cycle of poetry.
The Welsh Annals, Annales Cambriae, were probably compiled in the 10th century and makes two references to Arthur. The first mentions the battle of Badon, previously mentioned in the Historia, in which 'Arthur carried the cross of Christ for three days and nights on his shoulders' and the second refers to the battle of Camlan, 'in which Arthur and Medrawd died'.
Early texts
Early Welsh texts that provide an insight into Arthur in early literature include the poem Pa gur yv y porthaur? / Pa ŵr yw'r porthor? (What man is the gatekeeper?) and the prose tale Mal y Kauas Kulhwch Olwen, or How Culhwch won Olwen.
Both of these texts cannot be dated precisely yet both are believed to have been written before Geoffrey of Monmouth's Historia Regum Britanniae (see below). How Culhwch won Olwen, or Culhwch and Olwen, is an Arthurian romance and is the earliest tale in the Mabinogion, preserved in the Red Book of Hergest and as a fragment in the White Book of Rhydderch.
Pa gur yv y porthaur? / Pa ŵr yw'r porthor? (What man is the gatekeeper?) is a pre-Galfridian Arthurian poem (that is, a text written before Geoffrey of Monmouth's interpretation of Arthur) from the Black Book of Carmarthen. It is regarded as the most substantial Arthurian poem in the Black Book.