The history of Egypt under the Muhammad Ali dynasty (1805–1953) spanned the later period of Ottoman Egypt, the Khedivate of Egypt under British occupation, and the nominally independent Sultanate of Egypt and Kingdom of Egypt, ending with the Revolution of 1952 and the formation of the Republic of Egypt.