The battle of the Allia (18 July 390 B.C.) was one of the most embarrassing defeats in Roman history, and left the city defenceless in the face of a Gallic war band. This army, led by Brennus, was probably a raiding force attracted into central Italy by either the prospect of loot or the chance of serving as mercenaries in the wars of southern Italy.
During this period the Roman army was an amateur force, and the legions were only raised when they were needed for a particular campaign. The Gauls appear to have approached Rome too quickly for the legions to be levied, and far too fast for them to be properly organised or trained. As the Gauls approached Rome a small army left the city and advanced up to the point where the Allia River flows into the Tiber.
Livy gives a short account of the battle. The Roman army was much smaller than the Gallic force, and even though the Roman commanders expanded both of their flanks their line was still shorter than that of the Gauls. The Roman reserve was posted on a small hill to the right of their line.
When Brennus saw the Romans occupy this hill he assumed that they were hiding part of their army, and were planning to attack the Gauls in the flank from this position once battle had been joined in the centre. To prevent this he ordered his men to attack the Roman reserves instead of their main line.
As the Gauls advanced to attack the reserves the rest of the Roman army panicked. The left wing fled towards the recently captured city of Veii, which had much stronger fortifications than Rome. The right wing fled back towards Rome, where they took refuge in the Citadel, leaving the (apparently incomplete) walls of Rome undefended. Within a few days of the battle the city had been occupied and looted by the Gauls, although the Citadel probably held out until the Gauls were paid off.
Roman losses at the Allia were probably not very high, with most of the troops escaping into Veii and the rest into Rome. The Romans had probably been caught with their guard down, and their power doesn't appear to have suffered as a result of this disaster, although the threat from the Gauls became a Roman nightmare at least until the time of Caesar's Gallic War.