The Children of Israel were saved and Fir`awn's People drowned
Allah tells;
وَجَاوَزْنَا بِبَنِي إِسْرَايِيلَ الْبَحْرَ فَأَتْبَعَهُمْ فِرْعَوْنُ وَجُنُودُهُ بَغْيًا وَعَدْوًا حَتَّى إِذَا أَدْرَكَهُ الْغَرَقُ
And We took the Children of Israel across the sea, and Fir`awn with his hosts followed them in oppression and enmity, till when drowning overtook him, he (Fir`awn) said;"I believe that none has the right to be worshipped but He in Whom the Children of Israel believe, and I am one of the Muslims."
Allah tells how He caused Fir`awn and his soldiers to drown. The Children of Israel left Egypt in the company of Musa.
It was said that there were six hundred thousand soldiers, plus offspring. They borrowed a lot of ornaments from the Coptics and took that with them. Fir`awn became very angry with them. So he sent heralds to all the cities to send their soldiers. He embarked, following behind them, filled with great pride and with massive armies. Allah wanted this to happen for He had a plan for them. No one that had any authority or power remained behind in Fir`awn's kingdom. They were all together and caught the Children of Israel at sunrise.
فَلَمَّا تَرَاءَا الْجَمْعَانِ قَالَ أَصْحَـبُ مُوسَى إِنَّا لَمُدْرَكُونَ
And when the two hosts met each other, the companions of Musa said;"We are sure to be overtaken." (26;61)
They said that because when they got to the seashore Fir`awn was behind them. The two groups met face to face. The people with Musa kept asking, "How can we be saved today!"
Musa replied, "I have been commanded to come this way."
Musa said;
كَلَّ إِنَّ مَعِىَ رَبِّى سَيَهْدِينِ
Nay, verily, with me is my Lord. He will guide me. (26;62)
It had been so difficult, but it suddenly became easy. Allah commanded him to strike the ocean with his staff. He did and the sea was cleft asunder, each part stood like a mighty mountain. The sea was split into twelve paths, each route for each Israelite tribe.
Allah then commanded the wind and the path was dry for them.
فَاضْرِبْ لَهُمْ طَرِيقاً فِى الْبَحْرِ يَبَساً لاَّ تَخَافُ دَرَكاً وَلَا تَخْشَى
And strike a dry path for them in the sea, fearing neither to be overtaken (by Fir`awn) nor being afraid (of drowning in the sea). (20;77)
The water in between the paths appeared as windows and every tribe was able to see the other so they would not think that others were destroyed. The Children of Israel crossed the sea.
When the last one crossed, Fir`awn and his soldiers had arrived at the edge of the other shore. They were one hundred thousand black horses in addition to horsemen of other colors. When Fir`awn saw the sea he was frightened. He wanted to turn back, but it was too late. Allah's decree prevailed and the prayer of Musa was answered.
Jibril came on a war stallion. He passed by Fir`awn's horse. Jibril's horse whinnied at Fir`awn's and then Jibril rushed into the sea, and Fir`awn did the same behind him. Fir`awn no longer had any control over matters. He wanted to sound strong before his chiefs, so he said;"The Children of Israel do not have more right in the sea." So they rushed into the sea.
Mika'il was behind their army pushing them all to join. When they all were in the sea and the first of them was about to emerge on the other side, Allah, the All-Powerful, commanded the sea to strand them. The sea closed over them and none was saved. The waves took them up and down. The waves accumulated above Fir`awn and he was overwhelmed by the stupors of death. While in this state, he said;
قَالَ امَنتُ أَنَّهُ لا إِلِـهَ إِلاَّ الَّذِي امَنَتْ بِهِ بَنُو إِسْرَايِيلَ وَأَنَاْ مِنَ الْمُسْلِمِينَ
I believe that none has the right to be worshipped but He (Allah) in Whom the Children of Israel believe, and I am one of the Muslims.
He believed at a time when he couldn't benefit from his faith.
فَلَمَّا رَأَوْاْ بَأْسَنَا قَالُواْ ءَامَنَّا بِاللَّهِ وَحْدَهُ وَكَـفَرْنَا بِمَا كُنَّا بِهِ مُشْرِكِينَ
فَلَمْ يَكُ يَنفَعُهُمْ إِيمَـنُهُمْ لَمَّا رَأَوْاْ بَأْسَنَا سُنَّةَ اللَّهِ الَّتِى قَدْ خَلَتْ فِى عِبَادِهِ وَخَسِرَ هُنَالِكَ الْكَـفِرُونَ
So when they saw Our punishment, they said;"We believe in Allah Alone and reject (all) that we used to associate with Him as (His) partners."
Then their faith could not avail them when they saw Our punishment. (Like) this has been the way of Allah in dealing with His servants. And there the disbelievers lost utterly (when Our torment covered them). (40;84-85)
Therefore Allah said, as a response to Fir`awn