From 317 BC to 307 BC he was governor of Athens, serving under Cassander. When Demetrius I took Athens Demetrius Phalereus was overthrown, and he fled to Egypt. In Egypt Demetrius met Ptolemy I, and it is thought that it was his suggestion that inspired the creation of the Library of Alexandria. Demetrius went into exile a second time on the accession of Ptolemy Philadelphus, and he died soon afterward.