In late 312 BC, Ptolemy launched an invasion into the Levant from Egypt, he marched with 18,000 infantry and 4,000 cavalry along the northern edge of the Sinai Peninsula.
Demetrius deployed 2,900 elite cavalry, 1,500 light infantry, and 30 Indian war elephants under his command on the left.
The Antigonid phalanx of some 11,000 was deployed in the center, with 13 war elephants in front and light infantry protecting the main line.
While the cavalry battle on the flank was taking place, Demetrius brought forward his elephants apparently hoping to demoralize the Ptolemaic phalanx.
Demetrius lost 8,500 men (500 were killed in battle, a further 8,000 taken prisoner), including generals such as Andronicus of Olynthus, and all his elephants.
Meanwhile, Seleucus had convinced Ptolemy to release him from service and give him an army to try and take back his old province of Babylonia which was now without a governor (Peithon had died in the battle).