The country was firmly reunited by the Twenty-second Dynasty, which founded by Shoshenq I in 945 BC (or 943 BC), who descended from Meshwesh immigrants, originally from Ancient Libya. Shoshenq took Bubastis as his capital (Sharqia, Egypt).