The Old Kingdom was weakened by famine and weak leadership. The last Pharaoh of the 6th dynasty was Pepy II who probably reigned for 94 years, longer then any monarch in history. He was 6 when he ascended the throne and 100 years old when he died. The latter years of his reign were marked by ineffeciency because of Pepy's advanced age. When he died the Old Kingdom collapsed.
A dark time marked by unrest followed. The Union of the Two Kingdoms fell apart and regional leader had to cope with the famine.
Around 2160 BC a new line of Pharaohs tried to reunite Lower Egypt from their capital in Heracleopolis. In the meantime, however, a rival line based at Thebes was reuniting Upper Egypt and a clash between the two rival dynasties was inevitable.
The Pharaohs from Heracleopolis descended from a Pharaoh named Akhtoy and the first four Pharaohs from Thebes were named Inyotef or Antef.
Around 2055 BC a descendant of Inyotef defeated the Heracleopolitan Pharaohs, reunited the Two Lands, founded the 11th dynasty and ruled as Mentuhotep II thereby ending the First Intermediate Period.