Geoffrey of Monmouth's twelfth century History of the Kings of Britain is a popular source for legend about King Arthur, including tales relating to Merlin's prophecies. The story of Vortigern was popular in the Middle Ages because it contained clear warnings of the dangers of poor government: internal strife was sure to lead to foreign invasion.
According to the History, in the mid-fifth century Vortigern had become king of the Britons. He was suspected of the murder of his young nephew King Constans, and his realm was threatened by Saxon invasions and border raids by the Picts (medieval Scots) and the Scots (medieval Irish).
Vortigern's situation became increasingly desperate under the Saxon onslaught, and, forced to retreat westwards, he tried to establish a fortified base in Wales. But however hard he tried to construct the fortress, each morning the previous day's work had collapsed. Merlin was summoned, only to declare that two dragons were fighting beneath the fortress, shaking the mountain and destroying the buildings. The red dragon, representing the Britons, was being defeated by the white dragon of the Saxons. The omen was clear and Vortigern fled, leaving his kingdom first to his nephew Ambrosius Aurelianus and then to Uther Pendragon, father of Arthur.