On July 10, 48 BC, at the Battle of Dyrrhachium, Julius Caesar barely avoided a catastrophic defeat to Pompey near the city of Dyrrachium. An excerpt from the article:
"In early July, Pompey consolidated his army and stuck with as many as six legions on the vulnerable position. Caesar's IX legion, terribly overpowered, was forced to flee from the onslaught, and Pompey established a new camp on the outside of the wall.
Caesar attempted to reinforce the breach with 12 cohorts under Antony, and was initially successful in stemming the retreat. Caesar then drove back the Pompeians towards the sea, re-securing part of his wall in the process. 33 cohorts (3 legions) were sent against Pompey's new camp, but this is where things went terribly wrong.
The attackers were outmanned nearly two to one and though initially successful, they simply couldn't sustain the advantage. Caesar's right wing began to buckle as it was flanked and threatened from the rear. As the wing collapsed, Caesar's army panicked and began to rout. Caesar personally tried to stem the retreat, but all was lost, and the only course of action was to attempt to save his army. Caesar actually only lost 1,000 men in the battle, which was really a rather small affair considering the size of the armies, but the key was that Pompey could now claim a victory, and did so in earnest.
Pompey next made the most critical mistake of the entire war. Rather than continue to advance on Caesar's shaken lines, he decided to stand pat, seemingly feeling assured that Caesar was beaten and that the war was over. In reality, it very well could have been over if Pompey simply had attacked Caesar throughout his lines. His army very likely would have fallen into a complete rout and been captured or killed en masse.
Instead, Pompey seemed to lack the nerve to finish the job. Caesar himself said that "Today the victory had been the enemy's had there been any one among them to gain it."
Caesar gathered his army and moved away, hoping to lure Pompey away from his own source of supply. He followed initially, but petty squabbling within the Republican camp forced him to break off. Pompey and the Senators were more concerned over dividing up the spoils that were sure to come with victory than actually finishing the job. This respite granted Caesar enough time to invest and capture the town of Gomphi, where his army plundered and were fed. Re-energized, Caesar moved towards Pharsalus, where Pompey eventually moved to meet him."