Egypt is located in northern Africa along the Nile River valley. The ancient Egyptian civilization flourished here due to the fertile soil provided by annual flooding of the Nile. Egyptian society was highly stratified, with pharaohs and nobles at the top ruling over priests, skilled workers, and farmers. Farming and irrigation systems developed along the Nile allowed Egyptians to produce surplus crops, supporting large cities and advancement in other areas. Egyptian religion was polytheistic and involved mummification of the dead and judgment of the soul in the afterlife.