The end of the Ptolemaic era is a story of contraction, decline and disarray, when familiar troubles, including civil wars and dynastic assassinations continued to plague Egypt. After years of exile, Ptolemy XII died in 51 BC, leaving Egypt to Cleopatra VII and Ptolemy XIII.
Because Cleopatra stressed foreign policy, in effort to gain dominancy in Mediterranean area, she lived with powerful Romans, firstly Caesar and then Mark Antony. However, after the defeat at the battle of Actium in 31 BC, they committed suicide and Egypt became province.