General Napoleon Bonaparte (later Napoleon I) of France invaded Egypt in 1798. The main Ottoman army was preoccupied in European fronts and the only defenders were local forces which were routed in the Battle of Pyramids.[12] However Napeleon couldn't proceed much because his fleet was defeated by the British navy. In 1799 he returned and the French army evacuated Egypt following the Battle of Alexandria in 1801.