The Libyan prince Tefnakht from Saïs in the Delta drove Osorkon IV (the last king of the 22nd Dynasty) out of Memphis and became king himself. He was quickly confronted with the advancing rulers of Kush in the person of King Pye, who was attempting to win control over Upper Egypt as well. Pye conducted a campaign to the Delta and conquered Memphis. The majority of the Libyan princes pledged allegiance to Pye. A son of Tefnakht, Bakenrenef, was able to reconquer Memphis and crown himself king. Upper Egypt remained under the control of the kings of Kush, however. Shortly afterwards, Shabaka, a brother of Pye, would again rule over the whole of Egypt (25th Dynasty).