Retreat had been impossible, with the mountains on both flanks, whilst in front were their enemies, and in the rear their friends. When Castruccio saw that his men were unable to strike a decisive blow at the enemy and put them to flight, he sent one thousand infantrymen round by the castle, with orders to join the four hundred horsemen he had previously dispatched there, and commanded the whole force to fall upon the flank of the enemy. These orders they carried out with such fury that the Florentines could not sustain the attack, but gave way, and were soon in full retreat—conquered more by their unfortunate position than by the valour of their enemy. Those in the rear turned towards Pistoia, and spread through the plains, each man seeking only his own safety. The defeat was complete and very sanguinary. Many captains were taken prisoners, among whom were Bandini dei Rossi, Francesco Brunelleschi, and Giovanni della Tosa, all Florentine noblemen, with many Tuscans and Neapolitans who fought on the Florentine side, having been sent by King Ruberto to assist the Guelphs. Immediately the Pistoians heard of this defeat they drove out the friends of the Guelphs, and surrendered to Castruccio. He was not content with occupying Prato and all the castles on the plains on both sides of the Arno, but marched his army into the plain of Peretola, about two miles from Florence. Here he remained many days, dividing the spoils, and celebrating his victory with feasts and games, holding horse races, and foot races for men and women. He also struck medals in commemoration of the defeat of the Florentines. He endeavoured to corrupt some of the citizens of Florence, who were to open the city gates at night; but the conspiracy was discovered, and the participators in it taken and beheaded, among whom were Tommaso Lupacci and Lambertuccio Frescobaldi.