At the time, Cleopatra VII Thea Philopater was coregent with her father, Ptolemy XII Neos Dionysos Theos Philopater Theos Philadelphos, before his death. During Spring, 51 BC, Ptolemy XIII Theos Philopater succeeded his father, and became co-ruler with his sister, Cleopatra, as per Ptolemy’s will, executed by the Roman Senate. Cleopatra married her co-ruler brother, and their leadership roles reversed in October, 50 BC. Since Ptolemy was only 11 or 12 at the time, the eunuch Pothinus was appointed regent for him. Cleopatra was seven years older than her brother and over the next two years her influence as queen grew steadily – her portrait appeared on coinage, whereas Ptolemy’s name didn’t appear on official documents.
In Spring, 48 BC, Ptolemy and Pothinus attempted to depose Cleopatra, but she fled to Syria. Meanwhile, their elder half-sister, Arsinoe IV, proclaimed herself to be the rightful ruler and jointly ruled with Ptolemy. Arsinoe shared the same father as Cleopatra and Ptolemy, but different mother. Cleopatra organized an army and the country sank into civil war.
While all of this turmoil was happening in Egypt, the Roman world was also going through problems. Julius Caesar was in pursuit of Pompey the Great, who fled to Egypt for asylum. Ptolemy falsely granted him safety, and when the general arrived in Egypt he had him executed by Achillas and Lucius Septimius, hoping to gain favor from Caesar when he arrived. However, upon being presented with the head of Pompey, Caesar was disgusted with the dishonorable slaying of his rival and ordered his body recovered for a proper Roman funeral. Since Ptolemy was looking to ally with Caesar through treachery, Cleopatra took a more wily, and successful, approach to winning over Caesar. She became Caesar’s lover, and convinced him to have Pothinus executed and have the throne returned to her. She never divorced Ptolemy, but that didn’t appear to have created any hurdles.
Ptolemy still wanted Cleopatra out, so he allied with Arsinoe and rallied their forces against the troops loyal to Cleopatra and the forces Caesar brought with him to Alexandria. Achillas marched on the city with his 20,000 troops and 2000 cavalry. Caesar knew he didn’t have enough resources with him to defeat the combined forces of Ptolemy, Arsinoe and Achillas, so he sent ambassadors to Achillas to negotiate. Achillas executed the ambassadors and began the Siege of Alexandria.
Caesar had captured Arsinoe, but she escaped and joined Achillas when he arrived and occupied the city. Skirmishes between the two sides broke out all over the city, causing serious damage, and Plutarch attributed this as the cause of some of the buildings of the Great Library of Alexandria being destroyed. At some point during the battles, Caesar captured Ptolemy, but the conflict was still raging. While Arsinoe was with Achillas, dissention broke out and Arsinoe had Achillas put to death by Ganymedes, who then took over the troops. After some initial success against Caesar, some of the Egyptian officers were not pleased with how the battles were going and approached Caesar to negotiate peace by offering to exchange Arsinoe for Ptolemy. Ptolemy was released and picked up the war right where he left off.
Caesar had managed to stall long enough for reinforcements to arrive from Mithridates of Pergamum, son of Mithridates VI of Pontus, in January, 47 BC. Mithridates defeated the army sent to stop him and Caesar led his troops into Alexandria. Both sides now had around 20,000 troops and the armies met at The Battle of the Nile in February, 47 BC. The Romans destroyed one of the Ptolemaic forts and stormed it, forcing Ptolemy to flee. The Romans pursued and although the exact date is not universally clear, and many list January 13, one source (Mary Ann Bernal, in her History Trivia) lists March 25, 47 BC as the date Ptolemy drown in the Nile after his ship capsized while fleeing. This allowed Caesar to reinstate Cleopatra VII as the ruler of Egypt, who in turn elevated to co-ruler her other younger brother, Ptolemy XIV Theos Philopater II and had Arsinoe paraded through Rome, then exiled to the Temple of Artemis in Ephesus. Caesar also crowned Mithridates king of Bosporus Kingdom for his help in the battles of the Nile and Zela soon afterward. By request of Cleopatra, as she always saw her half-sister as a threat to her authority, Arsinoe was executed in 41 BC, on the temple steps by Marc Antony, in what was a huge scandal in Rome as it was a gross violation of the temple sanctuary.