Under Nectanebo I, a major rebuilding program was initiated for temples across the country. In Memphis, a powerful new wall was rebuilt for the Temple of Ptah, and developments were made to temples and chapels inside the complex. Nectanebo II meanwhile, while continuing the work of his predecessor, began building large sanctuaries, especially in the necropolis of Saqqara, adorning them with pylons, statues, and paved roads lined with rows of sphinxes. Despite his efforts to prevent the recovery of the country by the Persians, he succumbed to a massive invasion in 343 BC, and was defeated at Pelusium. Nectanebo II retreated south to Memphis, to which the emperor Artaxerxes III laid siege, forcing the king to flee to Upper Egypt, and eventually to Nubia.