"But Moses said, 'That would not be right. The sacrifices we offer the Lord our God would be detestable to the Egyptians. And if we offer sacrifices that are detestable in their eyes, will they not stone us? We must take a three-day journey into the wilderness to offer sacrifices to the Lord our God, as he commands us.'" NIV translation
Moses did not compromise as Pharaoh wanted but he also did not glorify God with his answer. He was right to refuse but when he gave the excuse of being afraid of the Egyptians instead of the fact that they had to obey God, he was wrong.
"Pharaoh said, 'I will let you go to offer sacrifices to the Lord your God in the wilderness, but you must not go very far. Now pray for me.' Moses answered, 'As soon as I leave you, I will pray to the Lord, and tomorrow the flies will leave Pharaoh and his officials and his people. Only let Pharaoh be sure that he does not act deceitfully again by not letting the people go to offer sacrifices to the Lord.'" NIV translation
When Pharaoh saw that Moses would not compromise on what God had told them to do, he apparently caved in again. Moses warned him to carry through on his promise.
"Then Moses left Pharaoh and prayed to the Lord, and the Lord did what Moses asked. The flies left Pharaoh and his officials and his people; not a fly remained. But this time also Pharaoh hardened his heart and would not let the people go." NIV translation
Once again, when the plague was lifted, Pharaoh did not keep his word. This is a reminder to us that unconditional surrender to the will of God will be demonstrated by our actions in serving Him.