The Middle Kingdom

The last ruler of the Old Kingdom, Pepy II, held power for a long time, perhaps 94 years. During his reign, the power of the king declined and provincial governors took control.
This shift in power had caused Egypt to fall into chaos, particularly that it was followed by a series of low Niles. This period is known as the First Intermediate Period, which lasted for about 140 years, during which the country was divided and at war. Nevertheless, Mentuhotep I, a southern king from Thebes (modern Luxor), managed to unite the country again. His reign marked the beginning of the Middle Kingdom’s era.
The first years of Mentuhotep’s reign were ones of bitter fighting. In the 14th year of his reign, however, he overthrew the people of Abydos in Lower Egypt and eventually extended his rule over the entire country. He reigned for 50 years and guided Egypt to a new era of peace and prosperity. The Middle Kingdom lasted for 250 years, and was marked by the rule of the kings of Dynasty XII. During this time, trade was built up with eastern Asia and the south, and the defensive “Walls of the Prince” were built to keep out the raiding hordes from Asia that tried to infiltrate the Delta from the east.
When the Middle Kingdom ended about 1785 B.C., the Second Intermediate Period began. It was a time of chaos and confusion, marked by the rule of the Hyksos. The Hyksos, coming from the east, took control of the Delta area of Egypt and made up Dynasty XV. Their reign lasted for 100 years.
The Hyksos were eventually expelled from Egypt by two Theban rulers, Kamose and Ahmose; Kamose took the Hyksos capital of Avaris and his younger brother Ahmose drove the Hyksos out of Egypt. With the princely line of Thebes in control of Egypt, Dynasty XVIII was born and the New Kingdom began