After centuries of upheaval and foreign incursions, Egypt was in disarray when Alexander established his own Pharaonic rule, reorganizing the country's government, founding a new capital city of Alexandria and validating the religion of the pharaohs. Upon his death in 323BC, the empire of Alexandria was divided among his Macedonian generals. Ptolemy I thus established the Ptolemaic Dynasty which ruled Egypt for three centuries. Under the Ptolemys Greek became the official language of Egypt and Hellenistic culture and ideas were introduced and synthesized with indigenous Egyptian theology, art, architecture and technology. The Ptolemy's synthesis of religious ideas resulted in the construction of the temples of Edfu and Kom Ombo, among other sacred structures. Alexandria became a great capital, housing one of history's greatest libraries. Gradually Ptolemaic rule was subverted by internal power struggles and foreign intervention. The Romans made inroads into Ptolemaic Egypt, supporting various rulers and factions until attaining total control over the country when Julius Caesar's armies attacked Alexandria. Queen Cleopatra VII was the last of the Ptolemaic rulers who reigned under the protection of the Caesar with whom she had a son. With the assassination of Caesar, Mark Antony arrived in Egypt and fell in love with Cleopatra, living with her for 10 years and helping Egypt retain its independence. The fleets of Octavian Caesar destroyed the Egyptian navy in the battle of Actium, driving Antony and Cleopatra to suicide and Egypt became a province of the Roman Empire.