After her father died in 51 BC, Cleopatra became queen of Egypt. To safeguard her throne and prevent Rome from conquering Egypt, she allied herself with Caesar, becoming his lover and visiting Rome on various occasions.
During her first trip to Rome, Cleopatra (who traveled with her husband) stayed at Caesar's villa. It is assumed that she signed a treaty of alliance with Rome, declaring her an ally and friend of the Roman people, according to Dio Cassius.
Julius Caesar acknowledged the queen's son as Ptolemy Caesar, but he did not publicly recognize Caesarion as his son or heir.
In 45 BC, Caesar named Octavian his adopted son and successor without mentioning Ptolemy Caesar in his will. However, there is a clause appointing guardians for "the child that may be born," suspecting the pregnancy of the Egyptian Queen.
However, in March 44 BC, C. Caesar was murdered, and Cleopatra and her entourage left Rome a month later to return to Egypt.