Then the Lord opened the eyes of Balaam, and he saw the angel of the Lord standing in the road, with his drawn sword in his hand; and he bowed down, falling on his face. The angel of the Lord said to him, “Why have you struck your donkey these three times? I have come out as an adversary, because your way is perverse before me. The donkey saw me, and turned away from me these three times. If it had not turned away from me, surely just now I would have killed you and let it live.” Then Balaam said to the angel of the Lord, “I have sinned, for I did not know that you were standing in the road to oppose me. Now therefore, if it is displeasing to you, I will return home.” The angel of the Lord said to Balaam, “Go with the men; but speak only what I tell you to speak.” So Balaam went on with the officials of Balak.
Numbers 22:31-35 (NRSV)