▁after ▁which ▁it ▁entered ▁a ▁period ▁of ▁slow ▁decl ine . ▁During ▁the ▁course ▁of ▁its ▁history ▁Egypt ▁was ▁inv aded ▁or ▁conquer ed ▁by ▁a ▁number ▁of ▁foreign ▁powers , ▁including ▁the ▁Hy ks os , ▁the ▁Lib y ans , ▁the ▁N ub ians , ▁the ▁Ass y ri ans , ▁the ▁A cha emen id ▁Pers ians , ▁and ▁the ▁Mac ed oni ans ▁under ▁the ▁command ▁of ▁Alexander ▁the ▁Great . ▁The ▁Greek ▁P to le ma ic ▁Kingdom , ▁formed ▁in ▁the ▁after math ▁of ▁Alexander ' s ▁death , ▁ruled ▁Egypt ▁until ▁ 3 0 ▁BC , ▁when , ▁under ▁Cle op atra , ▁it ▁fell ▁to ▁the ▁Roman ▁Empire ▁and ▁became ▁a ▁Roman ▁province . ▁▁ ▁The ▁success ▁of ▁ancient ▁Egypt ian ▁civil ization ▁came ▁partly ▁from ▁its ▁ability ▁to ▁adapt ▁to ▁the ▁conditions ▁of ▁the ▁N ile ▁River ▁valley ▁for ▁agricult ure . ▁The ▁predict able ▁flo oding ▁and ▁controlled ▁ir rig ation ▁of ▁the ▁fert ile ▁valley ▁produced ▁sur plus ▁cro ps , ▁which ▁supported ▁a ▁more ▁dense ▁population , ▁and ▁social ▁development ▁and ▁culture . ▁With ▁resources ▁to ▁spare , ▁the ▁administration ▁spons ored ▁min eral ▁explo itation ▁of ▁the ▁valley ▁and ▁surrounding ▁desert ▁regions , ▁the ▁early ▁development ▁of ▁an ▁independent ▁writing ▁system , ▁the ▁organization ▁of ▁collect ive ▁construction ▁and ▁agricult ural ▁projects , ▁trade ▁with ▁surrounding ▁regions , ▁and ▁a ▁military ▁intended ▁to ▁defeat ▁foreign ▁enemies ▁and ▁assert ▁Egypt ian ▁domin ance . ▁Mot iv ating ▁and ▁organ izing ▁these