This article does not cite any sources. (October 2013) (Learn how and when to remove this template message)
Coordinates: Ystrad Tywi (Welsh: [ˈəstrad ˈtəwɪ], Valley of the Tywi) is a region of southwest Wales situated on the both banks of the River Tywi. Although Ystrad Tywi was never a kingdom itself, it was historically a valuable territory and was fought over by the various kings of Dyfed, Deheubarth, Seisyllwg, Gwynedd, Morgannwg and the Normans.
At the start of the 8th century Ystrad Tywi was part of the kingdom of Dyfed. Around the year 730 Seisyll ap Clydog, king of Ceredigion, captured Ystrad Tywi from Rhain ap Cadwgan, king of Dyfed, and annexed it to his own kingdom. The name Seisyllwg was given to the new enlarged kingdom. As a result, Brycheiniog was once again detached from Dyfed; Ystrad Tywi had previously joined the two.
In an attempt to regain the lands previously held by his father Rhodri Mawr, in 894 king Anarawd ap Rhodri of Gwynedd—together with an English force from his ally Alfred the Great—laid waste to Ystrad Tywi and Ceredigion.
In medieval times Ystrad Tywi was divided into three cantrefi: Cantref Mawr on the north bank; Cantref Bychan and Cantref Eginawc on the south bank of the river. Eginawc (comprising the commotes of Gŵyr, Carnywyllawn, and Kidwelly) was lost to the Normans in the 11th century, and for the rest of the Middle Ages only the other two cantrefi formed Ystrad Tywi.
Ystrad Tywi was transformed into the county of Carmarthen when Edward I enacted the Statute of Rhuddlan in 1284 following the success of his war against Llywelyn ap Gruffudd, Prince of Wales. Though Gŵyr had by now become part of Glamorgan, the rest of Eginawc was later restored to Ystrad Tywi, which was joined with Gwarthaf (except Efelfre) to form the modern county of Carmarthenshire.
In the first branch of the Four Branches of the Mabinogi, the tale Pwyll Pendefig Dyfed is told of the son of Pwyll, Pryderi, following his father on the throne of Dyfed and adding the three cantrefi of Ystrad Tywi and the four cantrefi of Ceredigion to his kingdom.