Numbers 22:28-32
So, in anger, he again beat the ass with his stick.
But now the Lord opened the mouth of the ass, and she asked Balaam, "What have I done to you that you should beat me these three times?" "You have acted so willfully against me, " said Balaam to the ass, "that if I but had a sword at hand, I would kill you here and now." But the ass said to Balaam, "Am I not your own beast, and have you not always ridden upon me until now? Have I been in the habit of treating you this way before?" "No," replied Balaam.
Then the Lord removed the veil from Balaam's eyes, so that he too saw the angel of the Lord standing on the road with sword drawn; and he fell on his knees and bowed to the ground. But the angel of the Lord said to him, "Why have you beaten your ass these three times? It is I who have come armed to hinder you because this rash journey of yours is directly opposed to me."