The Nubian (Kushite) chieftain, Piy, advanced into Thebes where, having asserted control, he renamed himself Thutmose II, in homage to the 18th Dynasty pharaoh who had had converted the Kushites to the Cult of Amun. The incumbent pharaoh retreated to the Kingdom of Heraklepolis. Although Piy’s power was concentrated in the south, he also had the allegiance of the northern kingdoms, except for the kingdom of Tefnakht. Tefnakht was determined to conquer Thebes and, having made an ally of the ruler of Hermopolis, King Nimlot, he advanced southwards. Piy launched a counteroffensive and, after seizing the Middle Egyptian stronghold of the Libyans at Heropolis, advanced into Memphis. All the citadels in the local provinces fell and the delta rulers, including the Chiefdom of Ma and the final representatives of the 23rd Dynasty, paid homage to him. Later, in a temple at Sais, Tefnakht reluctantly swore an oath of allegiance.