“This is the order for you, you have written it yourself.”

Ibn Babawayh has quoted that water of Nile became lesser. People come to the Pharaoh and asked him to increase the water. The Pharaoh said, he is not happy with them, that is why he had made the water flow slowly. Again the people came to him and complained that their all animals died of thirst and warned, “If you don’t increase the water flow we will search for another God in your place.” The Pharaoh said, “All right, come with me to the forest.” He went aside in a corner, so the people cannot see or hear him. He kept his face on the ground and raised his forefinger towards the heavens and requested Allah and said, “There is no other God except He. And He is only able to make the water flow or stop it. Increase the flow for the sake of your people.” Allah heard his prayer as he is Knowing and Hearing. At once the water of Nile started flowing more as before. The Pharaoh said to his people that he had increased the water flow. Seeing this they made obeisance to the Pharaoh. Archangel Gabriel came to him and said, “I have a claim, so please be impartial.” He asked, what his complaint was? He (Archangel Gabriel said, “I gave the full authority to one of my servants on others. Now he keeps enmity with me and became a friend of my enemy. He is also against my friends. Do justice, and clear the matter.” the Pharaoh said, “Your servant has become disobedient. If he comes under my control I will drown him in the sea.” Archangel Gabriel said give me your assurance in writing. The Pharaoh ordered for a pen and a paper and wrote, “A person who is disobedient to his master and keeps enmity and makes friendship with the enemies of his master should be drowned in deep water.” Archangel Gabriel took his signature.
When the Pharaoh entered the water, Archangel Gabriel approached him with that paper and said, “This is the order for you, you have written it yourself.”

Reference: Hayat Al-Qulub, Vol. 1, Stories of the Prophets