The first prophecy against Egypt was given to Ezekiel (called “Son of man” 93 times) in the tenth year, in the tenth month on the twelfth day (Ezekiel 29:1-2). The date corresponds to January 7, 587 B.C. based on an analysis by German theologian Bernhard Lang. The second prophecy was given to Ezekiel in the twenty-seventh year, in the first month on the first day, which corresponds to April 26, 571 B.C. based on an analysis by German theologian Bernhard Lang.
The title “Pharaoh” applied to the royal ancient Egyptian kings until the Persian invasion. The title at the time of the prophecy (January 7, 587 BCE) refers to Hophra (c. 589-570 BCE) as noted in Jeremiah 44:30. He reigned for 19 years, the fourth king of the Twenty-sixth dynasty of Egypt.
Ezekiel 29:17: “And it came to pass in the twenty-seventh year, in the first month, on the first day of the month, that the word of the Lord came to me, saying...” The date corresponds to April 26, 571 BCE based on the analysis of Bernhard Lang.
Ezekiel 29:17–21 separates the oracles dated to January 587 BCE (29:1–16) and April 587 BCE (30:20-6) with the insertion of a later prophecy (announced in 571 BCE) that Egypt will be given by YHWH to the Babylonian king as compensation for his efforts on YHWH's behalf in the siege of Tyre (verse 20) which ended in 572 BCE. Egypt's defeat will bring honor to Israel who would then recognize YHWH. In his annals, Nebuchadrezzar recorded his invasion to Egypt in 568 BCE. Source: https://en.wikipedia.org/wiki/Ezekiel_29
Pharaoh Hophra (mentioned in Jeremiah 44:30) is identified as Pharaoh Apries (589-570 B.C.) Here is a brief overview of the events that relate to his exploits and eventual downfall:
In 588 BC, Apries dispatched a force to Jerusalem to protect it from Babylonian forces sent by Nebuchadnezzar II (Jer. 37:5; 34:21). His forces quickly withdrew, however, apparently avoiding a major confrontation with the Babylonians. Jerusalem, following an 18-month-long siege, was destroyed by the Babylonians in either 587 BC or 586 BC. Apries's unsuccessful attempt to intervene in the politics of the Kingdom of Judah was followed by a mutiny of soldiers from the strategically important Aswan garrison. While the mutiny was contained, Apries later attempted to protect Libya from incursions by Dorian Greek invaders, but his efforts backfired spectacularly, as his forces were mauled by the Greek invaders. When the defeated army returned home, a civil war broke out in the Egyptian army between the indigenous troops and the foreign mercenaries. The Egyptians threw their support to Amasis II, a general who had led Egyptian forces in a highly successful invasion of Nubia in 592 BC under Pharaoh Psamtik II, Apries' father.
When Apries marched back to Egypt in 567 BC with the aid of a Babylonian army to reclaim the throne of Egypt, he was likely killed in battle with Amasis' forces. Alternatively, Herodotus (Histories 2.169) holds that Apries survived the battle, and was captured and treated well by the victorious Amasis, until the Egyptian people demanded justice against him, whereby he was placed into their hands and strangled to death. Amasis thus secured his kingship over Egypt and was then its unchallenged ruler. The 26th Dynasty ends with the death of Apries, who was replaced by Amasis II, originally a general, and not of the royal house at all. Amasis and his son Psamtik III are the final rulers of the 26th Dynasty. Source: https://en.wikipedia.org/wiki/Apries
What happened to the Egypt after the demise of Pharaoh Apries (Hophra)?
The Twenty-seventh Dynasty of Egypt, also known as the First Egyptian Satrapy, was effectively a province (satrapy) of the Achaemenid Persian Empire between 525 BC and 404 BC. It was founded by Cambyses II, the King of Persia, after the Battle of Pelusium (525 BC) and the Achaemenid conquest of Egypt, and his subsequent crowning as Pharaoh of Egypt. It was disestablished upon the rebellion and crowning of Amyrtaeus as Pharaoh. A second period of Achaemenid rule in Egypt occurred under the Thirty-first Dynasty of Egypt (343–332 BC). https://en.wikipedia.org/wiki/Twenty-seventh_Dynasty_of_Egypt
Another source makes this comment regarding Ezekiel chapter 30:
The Egyptians continued to serve idols (Ezek. 30:13), and they continued to believe that they had sovereign rights in the Middle East that allowed them to oppose God’s purposes. According to commentators, Ezekiel 30:20 dates the oracle of judgment in today’s passage to April 29, 587 BC, during Nebuchadnezzar’s siege of Jerusalem leading up to his final conquest of the city. There is an apparent allusion here to Egypt’s involvement in the event as it took up arms against Babylon, coming to Jerusalem’s aid during the reign of King Zedekiah (Jer. 37:1–5). By this action, Egypt actually opposed the Lord, who had brought His “servant” Nebuchadnezzar against Jerusalem to destroy the city (25:9). Source: https://www.ligonier.org/learn/devotionals/egypt-falls-babylon/ (The Teaching Fellowship of R.C. Sproul)
With regard to the forty years (in verse 12) there may be a parallel with the forty years that God’s chosen people wandered in the wilderness. Prior to the exodus, God brought judgment on the Pharaoh and his household, on the land of Egypt and on the people of Egypt. The plagues were aimed at the false gods and goddesses worshiped by the nation. One source I have read suggests that the original downfall of Egypt happened at the time of the Exodus when Pharaoh and his army were destroyed by God as they pursued the Hebrews through the dry path of the Red Sea.
Egypt assuredly received a deadly wound. First, when the plagues fell upon all the land: ‘For the scripture said to Pharaoh, ‘Even for this same purpose have I raised you up, [P313] that I might show my power in you, and that my name might be declared throughout all the earth’, Romans 9:17. This took place when Egypt was devastated, and all the firstborn thereof slain, in the last of the ten plagues which set forth the power of God’s wrath. Secondly, Pharaoh and all his host were wounded with a deadly wound at the Red sea. By faith Israel passed over the Red sea as by dry land, which the Egyptians assaying to do were drowned, Hebrews 11:29, Psalm 66:6. Israel passed over dryshod. Not so Pharaoh and his host, Exodus 14:30; 15:4-5; 10, 11.
Yes, Egypt recovered from that initial wound, only to rise up against the Almighty during the time of Jeremiah and Ezekiel and face further judgment. Yet prophecies in Daniel and Revelation return to a similar theme, whereby the nations (Egypt, Babylon, the Medes and the Persians, Greece and Rome) oppose the Sovereign Lord God to their eternal ruination. The author of the preceding paragraph suggests there is indeed a spiritual element to these events:
But I am inclined to think, in keeping with the tenor and spiritual imagery which gives – however astoundingly – tangible form or figure to things both intangible and invisible, that, in concert with the consistent presentation of the Book of the Revelation, and agreeable to its invariable spiritual principles, the interpretation must be visionary rather than coldly literal.
When Pharaoh and all his host were smitten – as with all God’s dealings with and on behalf of Israel – this was but an earthly figure, a shadow and not at all the reality itself, neither the very substance. But if Christ rose, all rise. And if all rise, here is the substance of the matter, the final revelation. But this, being past death and the grave, puts everything beyond the reach, power authority, realm, sphere, and existence of the prince of this world. Acts 13:30-31; 10:39-41. Source: ‘The Revelation of Jesus Christ’ by John Metcalfe, Chapter 13, pages 313-317
I do not presume to say when, exactly, the prophecy in Ezekiel 29:12 had a literal fulfilment, although historical events indicate Egypt was “cast down” when the Persians conquered Egypt and placed their own “puppet rulers” on the throne. The era of the Pharaohs had come to an end.
Just as there is a spiritual concept to the powers described in Revelation (such as 'Babylon'), so too there is a spiritual concept to the beasts that arise out of the sea and the land to oppose God’s people at the climax of events during the ‘last days’. The imagery is that of nations, rulers and authorities rising up to destroy God’s people. We may not have heard the last of Egypt, spiritually speaking.