The Lord said to Moses, "Early tomorrow morning go and meet the king as he goes to the river, and tell him that the Lord says, "Let my people go, so that they can worship me.
I warn you that if you refuse, I will punish you by sending flies on you, your officials, and your people. The houses of the Egyptians will be full of flies, and the ground will be covered with them.
But I will spare the region of Goshen, where my people live, so that there will be no flies there. I will do this so that you will know that I, the Lord, am at work in this land.
I will make a distinction between my people and your people. This miracle will take place tomorrow.' "
References for Exodus 8:23
The Lord sent great swarms of flies into the king's palace and the houses of his officials. The whole land of Egypt was brought to ruin by the flies.
Then the king called for Moses and Aaron and said, "Go and offer sacrifices to your God here in this country."
"It would not be right to do that," Moses answered, "because the Egyptians would be offended by our sacrificing the animals that we offer to the Lord our God. If we use these animals and offend the Egyptians by sacrificing them where they can see us, they will stone us to death.
We must travel three days into the desert to offer sacrifices to the Lord our God, just as he commanded us."
The king said, "I will let you go to sacrifice to the Lord, your God, in the desert, if you do not go very far. Pray for me."
Moses answered, "As soon as I leave, I will pray to the Lord that tomorrow the flies will leave you, your officials, and your people. But you must not deceive us again and prevent the people from going to sacrifice to the Lord."
Moses left the king and prayed to the Lord,
and the Lord did as Moses asked. The flies left the king, his officials, and his people; not one fly remained.
But even this time the king became stubborn, and again he would not let the people go.