Egyptian government was a theocracy. The government used the power of religion as a control in ruling the country. The pharaoh was the head of the state and also the divine representative of the gods. During the old kingdom, the pharaohs considered themselves to be living gods ruling with absolute power. By the middle kingdom, they were representatives of the gods on earth. To reinforce their images as the representatives of the gods they were often depicted as warriors who single-handedly defeated their enemies. The different pharaohs and the eras in which they ruled, are classified into dynasties. There are thirty-one dynasties in all. However, the thirty-first dynasty was not under the control of Egyptian rulers and for the rest of Egypt's existence the country was ruled by other powers. Also, not all pharaohs were men. There were several female rulers the most famous of which is Queen Hatshepsut.
Of course, pharaohs did not single-handedly rule Egypt. One of the earliest forms of bureaucracy was started in ancient Egypt. The pharaoh or king was the supreme head of state. Right below him was the vizier, who was the prime minister, head priest and the executive head of the bureaucracy. The vizier was also the supreme judge of the state and ruled on all petitions and grievances brought to the court. All royal commands were dispersed through the vizier before being given to the lower officials and administrators in his office. Then these lower officials dispatched these orders to governors in charge of specific areas of Egypt.