The beginning of the end for the western Empire was the Huns. The Huns were warriors of the central Asian steppes: expert horsemen, vicious warriors, unattached to any particular land. They had much in common with other groups of steppe peoples like the Scythians who had raided civilized lands going back to the very emergence of civilization in Mesopotamia. They were known to be so cruel and so unstoppable that the Germanic barbarians further west claimed that they were the product of unions between demons and witches, rather than normal humans.
In 376 the Huns drove a tribe of Goths from their lands in southern Russia. Those Goths were allowed to settle in the Balkans by the Romans, but were soon extorted by Roman officials, causing the Goths to rise up against Rome in retribution. In 378 the Goths killed the emperor, Valens, and destroyed a Roman army in an open battle. The new emperor made a deal with the Goths, allowing them to serve in the Roman army under their own commanders in return for payment. This proved disastrous for Rome in the long run as the Goths, under their king Alaric, started looting Roman territory in the Balkans, finally marching into Italy itself and sacking Rome in 410 CE; the Roman government officially moved to the city of Ravenna in the north (which was more defensible) following this sack.
The Gothic attack on Rome was the first time in roughly seven hundred years that the walls of Rome had been breached by non-Romans. The entire Roman world was shocked and horrified that mere barbarians could have overwhelmed Roman armies and struck at the heart of the ancient Empire itself. Rome’s impregnability was itself one of the founding stories Romans told themselves; Romans had long vowed that the Celtic sack of 387 BCE would be the last, and yet the Goths had shattered that myth. With the benefit of historical hindsight, we can see the arrival of the Huns as the beginning of a "domino effect" in which various barbarian groups were pushed into Roman territory, with the sack of Rome merely one disaster of many for the Empire.
Leading up to that event, the Roman legions were already losing their former coherence and unity. In 406 CE a very cold winter froze the Rhine river, and armies of barbarians invaded (literally walking across the frozen river in some cases), bypassing the traditional Roman defenses. One group, the Vandals, sacked its way to the Roman provinces of Spain and seized a large swath of territory there. The entire army of Britain left in 407 CE, when yet another ambitious general tried to seize the imperial throne, and Roman power there swiftly collapsed.
Roman armies from the western Empire hastily marched back to Italy to fight the Goths, abandoning their traditional defensive posts. For the next fifty years, various groups of Germanic invaders wandered across Europe, both looting and, soon, settling down to occupy territory that had only recently been part of the Roman Empire. Most of these groups soon established kingdoms of their own. The Vandals pushed through Spain and ended up conquering most of Roman North Africa. After the Goths sacked Rome itself in 410, the emperor Honorius gave them southern Gaul to get them to leave; they ended up seizing most of Spain (from the Vandals who had arrived before them) as well. At that point, the Romans came to label this group the Visigoths - “western Goths” - to distinguish them from other Gothic tribes still at large in the Empire.
Back in Italy, the Huns, under the leadership of the legendary warlord Attila, arrived in the late 440s, pushing as far as the gates of Rome in 451. There, the Pope (Leo I) personally appealed to Attila not to sack the city and paid them a hefty bribe. Attila died in 453 and the Huns were soon defeated by a combined army of their former German subjects and a Roman army. By then, however, the damage was done: the domino effect set off by the Hunnic invasion of the previous century had already almost completely swallowed up the western Empire. Only two years after the Huns were defeated, the Vandals sailed over from Africa in 455 and sacked Rome again. This sacking, despite occurring with relatively little carnage, nevertheless led to the use of the word “vandal” to mean a malicious destroyer of property.
Italy itself held out until 476, when an Ostrogothic (“eastern Goth”) warlord named Odoacer deposed the last emperor and declared himself king of Italy; the Roman emperor in Constantinople (having little choice) approved of Odoacer’s authority in Italy in return for a nominal pledge of loyalty. Subsequently, Odoacer was deposed and killed by a different Ostrogothic king, Theodoric, in 493, but the link with Constantinople remained intact. The Roman emperor worked out a deal with Theodoric to stabilize Italy, and Theodoric went on to rule for decades (r. 493 - 526). Thus, by 500 CE Italy and the city of Rome were no longer part of the Empire still called "Roman" by the people of the eastern Empire. By the end of the fifth century, the western Empire was gone, replaced by a series of kingdoms ruled by Germanic peoples but populated by former citizens of the Roman Empire.
Theodoric presided over a few decades of prosperity, restoring peace to the Italian peninsula and joining together with other Gothic territories to the west. He maintained excellent relations with the Pope even though he was an Arian Christian, and he set up a system in which a government existed for his Goths that was distinct from the Roman government (with him at the head of both, of course). Some historians have speculated that Theodoric and the Goths might have been able to forge a new, stable Empire in the west and thereby obviate the coming of the "Dark Ages," but that possibility was cut short when the Byzantine Empire invaded to try to reconquer its lost territory (that invasion is considered in the next chapter).
In Gaul, a fierce tribe called the Franks, from whom France derives its name, came to power, driving out rivals like the Visigoths. Unlike the other Germanic tribes, the Franks did not abandon their homeland when they set out for new territory. From the lower Rhine Valley, they gradually expanded into northern Gaul late in the fifth century. Under the leadership of the warrior chieftain Clovis (r. 481/482 - 511), the various Frankish tribes were united, which gave them the military strength to depose the last Roman governor in Gaul, drive the Visigoths into Spain, absorb the territory of yet another barbarian group known as the Burgundians, and eventually conquer most of Gaul. Thus, what began as invasion and occupation of Roman territory evolved in time to become the earliest version of the kingdom of France.
In almost every case, the new Germanic kings pledged formal allegiance to the Roman emperor in Constantinople in return for acknowledgment of the legitimacy of their rule (Clovis of the Franks made a point of having the Frankish laws recorded in Latin, and over time the Frankish language vanished, replaced by the early form of French, a Latinate language). In fact, for well over a century, most Germanic “kings” were, officially, treaty-holding, recognized Roman officials from the legal and diplomatic perspective of Constantinople. That said, the “Roman” emperors of Constantinople had plenty of legal pretext to regard those kings as usurpers as well, since the treaties of acknowledgment were often full of loopholes. Thus, when the emperor Justinian invaded Italy in the sixth century, he was doing so to reassert not just the memory of the united Empire, but to restore the Empire to the legal state in which it already technically existed.