At this point defeated Roman general Pompey came to Egypt seeking refuge from his persuing rival Julius Caesar. Initially Ptolemy and Potheinus pretended to have accepted his request but on September 29, 48 BC, Potheinus himself murdered the general in hopes of winning favor with Caesar when the victorious general arrived. When Caesar did arrive he was presented with the head of his deceased rival and former ally but reportedly instead of being pleased reacted with disgust. Cleopatra proved more successful in winning Caesar's favor and became his lover. Caesar arranged the execution of Potheinus and the official return to the throne of Cleopatra, though she had never officially abdicated, and her marriage to Ptolemy.
Still determined to depose Cleopatra, Ptolemy allied himself with Arsinoe IV and jointly they organized the factions of the army royal to them against those loyal to Cleopatra and the relatively small part of his army that had accompanied Caesar to Egypt. The battle between the warring factions occurred in middle December of 48 BC inside Alexandria itself which suffered serious damage including according to some sources the burning of some of the buildings which consisted the Library of Alexandria. The arrival of Roman reinforcements from Pergamum offered the victory to Caesar and Cleopatra and Ptolemy and Arsinoe had to flee the city. Ptolemy reportedly drowned on January 13, 47 BC while attempting to cross the Nile. Whether he was attempting to further flee or heading towards negotiations remains uncertain in our sources of the time. Cleopatra remained the unquestionable ruler of Egypt although she named their younger brother Ptolemy XIV of Egypt her new co-ruler.