|This article is about the eunuch. You may be looking for the magistrate.|
In 48 BCE, the Roman general Julius Caesar arrived in Alexandria and decided to arbitrate the rival claims of Ptolemy and Cleopatra to the Egyptian throne. Ptolemy's advisor Pothinus ordered the general Achillas to march on Alexandria with 20,000 men to stop Caesar, who soon allied himself with Cleopatra. As Caesar was besieged in the royal palace with Ptolemy as his prisoner, Arsinoë and Ganymedes escaped to join Achillas.
On Arsinoë's orders, Achillas was executed, and Ganymedes took command of his forces. He proved a capable tactician, supposedly being responsible for the decision to capture Caesar's fleet and trapping him inside the palace. He also had his men take control of the canals of Alexandria, isolating their own water supply before pouring salt water into the canals and cisterns leading to Caesar's camp. Caesar countered this move by ordering the construction of wells.
After recapturing the harbor, Caesar sailed out to personally meet the 37th Legion, before defeating Ganymedes' in a naval battle against all odds. He took the Lighthouse of Alexandria, signalling for his allies, before his troops were forced into a retreat. The Alexandrians supporting Ptolemy grew weary of Arsinoë and Ganymedes, and wanted their king back. Caesar agreed to exchange Ptolemy for Arsinoë and Ganymedes on the condition that the king end the war and remain loyal to Rome. Ptolemy soon broke the agreement, and was delivered a final defeat by Caesar at the Battle of the Nile.