When Pharaoh finally sent the Jews out, he told Moshe and Aharon, “Go! Take your people, your animals, everything. Go serve your G-d, and you should bless me as well.”
Rashi says that “you should bless me” means that they should pray for him that he not die. He thought he would because he was a first-born.
While there are different opinions as to whether the first-borns died in a single moment across Egypt or chatzos, midnight, in each area based on its own “time zone,” Pharaoh for some reason was still alive and he feared that he would die soon.
However, he was not to die in the plague of Makos Bechoros because he was still needed to play his part on the world stage.
Later, he would be the king of Nineveh and when Yonah came to prophecy that the city would be overturned, Pharaoh listened and his entire country repented.
One never knows what HaShem’s plans are in the future, or how today’s suffering may really be the stepping stone to future redemption.
Though Pharaoh thought he understood the endgame, that HaShem wanted him gone, he was far off base, because HaShem wanted him around for a long, long time.
