Muhammad Ali Pasha al-Mas'ud ibn Agha was an Ottoman governor of Egypt, often referred to as the founder of modern Egypt. He ruled over Lower Egypt, Upper Egypt, Sudan and parts of Arabia and the Levant during his reign. Ali was born in Kavala, Ottoman Macedonia, and had Albanian origins. He and his family controlled Egypt for over 147 years, and their influence can still be seen in modern Alexandria and its culture. Although he reached Egypt as a Turkish army officer, he ended up ruling the nation for most of his life. He was sent to recover Egypt from a French occupation that was earlier ruled by Napoleon. Once Napoleon withdrew from Egypt, Ali rose to power, thanks to his political prowess. He became the Wāli (viceroy) of Egypt and attained the rank of Pasha. He brought in a lot of reforms in the military, economic and cultural spheres, and paved the way for the modernization of Egypt. Ali is also credited for ending the Mamluk reign over Egypt, and he and his descendants ruled over Egypt up until the mid-20th century.