According to legend, the town is named after Tydfil, a daughter of King Brychan of Brycheiniog. According to her legend, she was slain at Merthyr by pagans around 480; the place was subsequently named Merthyr Tydfil in her honour. Although merthyr generally means "martyr" in modern Welsh, the meaning here is closer to the Latin martyrium: the mausoleum or church built over the relics of a martyr. Similar examples, all from south Wales, include Merthyr Cynog, Merthyr Dyfan and Merthyr Mawr.
Peoples migrating north from Europe had lived in the area for many thousands of years. The archaeological record starts from about 1000 BC with the Celts. From their language, the Welsh language developed. Hillforts were built during the Iron Age and the tribe that inhabited them in the south of Wales were called the Silures, according to Tacitus, the Roman historian of the Roman invaders.
The Romans arrived in Roman Wales by about 47–53 AD and established a network of forts, with roads to link them. They had to fight hard to consolidate their conquests, and in 74 AD they built an auxiliary fortress at Penydarren, overlooking the River Taff. It covered an area of about three hectares, and formed part of the network of roads and fortifications; remains were found underneath the football ground where Merthyr Tydfil FC play. A road ran north–south through the area, linking the southern coast with Mid Wales and Watling Street via Brecon. Parts of this and other roads, including Sarn Helen, can be traced and walked.
The Silures resisted this invasion fiercely from their mountain strongholds, but the Romans eventually prevailed. In time, relative peace was established and the Penydarren fortress was abandoned by about 120 AD. This had an unfortunate effect upon the local economy, which had come to rely upon supplying the fortress with beef and grain, and imported items such as oysters from the coast. Intermarriage with local women had occurred and many auxiliary veterans had settled locally on farms.
With the Decline of the Roman Empire, Roman legions were withdrawn around 380 AD. By 402 AD, the army in Britain comprised mostly Germanic troops and local recruits, and the cream of the army had been withdrawn across to the continent of Europe. Sometime during this period, Irish Dalriadan (Scots) and Picts attacked and breached Hadrian's Wall. During the 4th and 5th centuries the coasts of Cambria (Wales) had been subject to the raids of Irish pirates, in much the same way as the south and east coasts of Britain had been raided by Saxon pirates from across the North Sea. Around the middle of the 5th century, Irish settlements had been established around Swansea and the Gower Peninsula and in Pembrokeshire and eventually petty kingdoms were establish as far inland as Brecon. By about 490 AD hordes of Saxons invaded and settled in the east or "lowland" Britain and the locals were left to their own devices to fight off these new invaders.