Numbers 22:12-31 NIV
But God said to Balaam, “Do not go with them. You must not put a curse on those people, because they are blessed.”
The next morning Balaam got up and said to Balak’s officials, “Go back to your own country, for the LORD has refused to let me go with you.”
So the Moabite officials returned to Balak and said, “Balaam refused to come with us.”
Then Balak sent other officials, more numerous and more distinguished than the first. They came to Balaam and said:
“This is what Balak son of Zippor says: Do not let anything keep you from coming to me, because I will reward you handsomely and do whatever you say. Come and put a curse on these people for me.”
But Balaam answered them, “Even if Balak gave me all the silver and gold in his palace, I could not do anything great or small to go beyond the command of the LORD my God. Now spend the night here so that I can find out what else the LORD will tell me.”
That night God came to Balaam and said, “Since these men have come to summon you, go with them, but do only what I tell you.”
Balaam got up in the morning, saddled his donkey and went with the Moabite officials. But God was very angry when he went, and the angel of the LORD stood in the road to oppose him. Balaam was riding on his donkey, and his two servants were with him. When the donkey saw the angel of the LORD standing in the road with a drawn sword in his hand, it turned off the road into a field. Balaam beat it to get it back on the road.
Then the angel of the LORD stood in a narrow path through the vineyards, with walls on both sides. When the donkey saw the angel of the LORD, it pressed close to the wall, crushing Balaam’s foot against it. So he beat the donkey again.
Then the angel of the LORD moved on ahead and stood in a narrow place where there was no room to turn, either to the right or to the left. When the donkey saw the angel of the LORD, it lay down under Balaam, and he was angry and beat it with his staff. Then the LORD opened the donkey’s mouth, and it said to Balaam, “What have I done to you to make you beat me these three times?”
Balaam answered the donkey, “You have made a fool of me! If only I had a sword in my hand, I would kill you right now.”
The donkey said to Balaam, “Am I not your own donkey, which you have always ridden, to this day? Have I been in the habit of doing this to you?”
“No,” he said.
Then the LORD opened Balaam’s eyes, and he saw the angel of the LORD standing in the road with his sword drawn. So he bowed low and fell facedown.
NIV: New International Version