The Battle of Ascalon took place on August 12, 1099, and is often considered the last action of the First Crusade.
The crusaders acted quickly. Godfrey of Bouillon was named Defender of the Holy Sepulchre on July 22, and Arnulf of Chocques, named patriarch of Jerusalem on August 1, discovered a relic of the True Cross on August 5. Fatimid ambassadors arrived to order the crusaders to leave Jerusalem, but they were ignored. On August 10 Godfrey led the remaining crusaders out of Jerusalem towards Ascalon, a day's march away, while Peter the Hermit led both the Catholic and Greek Orthodox clergy in prayers and a procession from the Holy Sepulchre to the Temple. Robert II of Flanders and Arnulf accompanied Godfrey, but Raymond IV of Toulouse and Robert of Normandy stayed behind, either out of a quarrel with Godfrey or because they preferred to hear about the Egyptian army from their own scouts. When the Egyptian presence was confirmed, they marched out as well the next day. Near Ramla, they met Tancred and Godfrey's brother Eustace, who had left to capture Nablus earlier in the month. At the head of the army, Arnulf carried the relic of the Cross, while Raymond of Aguilers carried the relic of the Holy Lance that had been discovered at Antioch the previous year.
On the morning of the 12th, crusader scouts reported the location of the Fatimid camp and the army marched towards it. During the march the crusaders had been organized into nine divisions: Godfrey led the left wing, Raymond the right, and Tancred, Eustace, Robert of Normandy and Gaston IV of Béarn made up the centre; they were further divided into two smaller divisions, and a division of foot-soldiers marched ahead of each. This arrangement was also used as the line of battle outside Ascalon, with the center of the army between the Jerusalem and Jaffa Gates, the right aligned with the Mediterranean coast, and the left facing the Jaffa Gate.
According to most accounts (both crusader and Muslim), the Fatimids were caught unprepared and the battle was short, but Albert of Aix states that the battle went on for some time with a fairly well-prepared Egyptian army. The two main lines of battle fought each other with arrows until they were close enough to fight hand-to-hand with lances. The Ethiopians attacked the centre of the crusader line, and the Fatimid vanguard was able to outflank the crusaders and surround their rearguard, until Godfrey arrived to rescue them. Despite his numerical superiority, al-Afdal's army was hardly as strong or dangerous as the Seljuk armies that the crusaders had encountered previously. The battle seems to have been over before the Fatimid heavy cavalry was prepared to join it. Al-Afdal and his panicked troops fled back to the safety of the heavily fortified city; Raymond chased some of them into the sea, others climbed trees and were killed with arrows, while others were crushed in the retreat back into the gates of Ascalon. Al-Afdal left behind his camp and its treasures, which were captured by Robert and Tancred. Crusader losses are unknown, but the Egyptians lost about 10–12,000 men.
Ascalon remained under Fatimid control and was soon re-garrisoned. It became the base of operations for invasions of the Kingdom of Jerusalem every year afterwards, and numerous battles were fought there in the following years, until 1153 when it was finally captured by the crusaders in the Siege of Ascalon.