Then the Lord said to Moses, "Rise early in the morning and present yourself before Pharaoh, as he goes out to the water, and say to him, "Thus says the Lord: Let my people go, so that they may worship me.
For if you will not let my people go, I will send swarms of flies on you, your officials, and your people, and into your houses; and the houses of the Egyptians shall be filled with swarms of flies; so also the land where they live.
But on that day I will set apart the land of Goshen, where my people live, so that no swarms of flies shall be there, that you may know that I the Lord am in this land.
Thus I will make a distinction between my people and your people. This sign shall appear tomorrow.' "
References for Exodus 8:23
The Lord did so, and great swarms of flies came into the house of Pharaoh and into his officials' houses; in all of Egypt the land was ruined because of the flies.
Then Pharaoh summoned Moses and Aaron, and said, "Go, sacrifice to your God within the land."
But Moses said, "It would not be right to do so; for the sacrifices that we offer to the Lord our God are offensive to the Egyptians. If we offer in the sight of the Egyptians sacrifices that are offensive to them, will they not stone us?
We must go a three days' journey into the wilderness and sacrifice to the Lord our God as he commands us."
So Pharaoh said, "I will let you go to sacrifice to the Lord your God in the wilderness, provided you do not go very far away. Pray for me."
Then Moses said, "As soon as I leave you, I will pray to the Lord that the swarms of flies may depart tomorrow from Pharaoh, from his officials, and from his people; only do not let Pharaoh again deal falsely by not letting the people go to sacrifice to the Lord."
So Moses went out from Pharaoh and prayed to the Lord.
And the Lord did as Moses asked: he removed the swarms of flies from Pharaoh, from his officials, and from his people; not one remained.
But Pharaoh hardened his heart this time also, and would not let the people go.