At this point, Caesar abandoned his plans to annex Egypt, instead backing Cleopatra's claim to the throne. After Mithridates raised the siege of Alexandria, Caesar defeated Ptolemy's army at the Battle of the Nile; Ptolemy XIII drowned in the Nile and Caesar restored Cleopatra to her throne, with another younger brother Ptolemy XIV as her new co-ruler. When Caesar left Egypt he stationed a Roman occupying army of three legions there under the command of Rufio.
Cleopatra and Caesar (1866). Painting by Jean-Léon Gérôme
Although Cleopatra was 21 years old when they met and Caesar was 52, they became lovers during Caesar’s stay in Egypt between 48 BC and 47 BC. Cleopatra claimed Caesar was the father of her son and wished him to name the boy his heir, but Caesar refused, choosing his grandnephew Octavian instead. During this relationship, it was also rumored that Cleopatra introduced Caesar to her astronomer Sosigenes of Alexandria, who proposed the idea of leap days and leap years. This was not new - they were proclaimed in 238 BC but the reform never took effect. Caesar made this the basis of his reform of the Roman calendar in 45 BC and the Egyptian calendar was reformed along these lines in 26 BC.
Cleopatra VII and her son Caesarion at the Temple of Dendera
Cleopatra, Ptolemy XIV and Caesarion visited Rome in the summer of 46 BC. The Egyptian queen resided in one of Caesar's country houses, which included the Horti Caesaris just outside Rome (as a foreign head of state she was not allowed inside Rome's pomerium) The relationship between Cleopatra and Caesar was obvious to the Roman people and caused a scandal because the Roman dictator was already married to Calpurnia Pisonis. But Caesar even erected a golden statue of Cleopatra represented as Isis in the temple of Venus Genetrix (the mythical ancestress of Caesar's family), which was situated at the Forum Julium. The Roman orator Cicero said in his preserved letters that he hated the foreign queen. Cleopatra and her entourage were still in Rome when Caesar was assassinated on 15 March 44 BC., returning with her relatives to Egypt. When Ptolemy XIV died – allegedly poisoned by his older sister – Cleopatra made Caesarion her co-regent and successor and gave him the epithets Theos Philopator Philometor (= Father- and mother-loving God).
(source)