Numbers 22:30-37
English Standard Version
31Then the Lord opened the eyes of Balaam, and he saw the angel of the Lord standing in the way, with his drawn sword in his hand. And he bowed down and fell on his face.
32And the angel of the Lord said to him, "Why have you struck your donkey these three times? Behold, I have come out to oppose you because your way is perverse before me.
33The donkey saw me and turned aside before me these three times. If she had not turned aside from me, surely just now I would have killed you and let her live."
34Then Balaam said to the angel of the Lord, "I have sinned, for I did not know that you stood in the road against me. Now therefore, if it is evil in your sight, I will turn back."
35And the angel of the Lord said to Balaam, "Go with the men, but speak only the word that I tell you." So Balaam went on with the princes of Balak.