Numbers 22:1-21 (NRSV)
King Balak asks Balaam to curse Israel
The Israelites set out, and camped in the plains of Moab across the Jordan from Jericho. Now Balak son of Zippor saw all that Israel had done to the Amorites. Moab was in great dread of the people, because they were so numerous; Moab was overcome with fear of the people of Israel. And Moab said to the elders of Midian, "This horde will now lick up all that is around us, as an ox licks up the grass of the field." Now Balak son of Zippor was king of Moab at that time. He sent messengers to Balaam son of Beor at Pethor, which is on the Euphrates, in the land of Amaw, to summon him, saying, "A people has come out of Egypt; they have spread over the face of the earth, and they have settled next to me. Come now, curse this people for me, since they are stronger than I; perhaps I shall be able to defeat them and drive them from the land; for I know that whomever you bless is blessed, and whomever you curse is cursed."
So the elders of Moab and the elders of Midian departed with the fees for divination in their hand; and they came to Balaam, and gave him Balak's message. He said to them, "Stay here tonight, and I will bring back word to you, just as the Lord speaks to me"; so the officials of Moab stayed with Balaam. God came to Balaam and said, "Who are these men with you?" Balaam said to God, "King Balak son of Zippor of Moab, has sent me this message: 'A people has come out of Egypt and has spread over the face of the earth; now come, curse them for me; perhaps I shall be able to fight against them and drive them out.'" God said to Balaam, "You shall not go with them; you shall not curse the people, for they are blessed." So Balaam rose in the morning, and said to the officials of Balak, "Go to your own land, for the Lord has refused to let me go with you." So the officials of Moab rose and went to Balak, and said, "Balaam refuses to come with us."
Once again Balak sent officials, more numerous and more distinguished than these. They came to Balaam and said to him, "Thus says Balak son of Zippor: 'Do not let anything hinder you from coming to me; for I will surely do you great honor, and whatever you say to me I will do; come, curse this people for me.'" But Balaam replied to the servants of Balak, "Although Balak were to give me his house full of silver and gold, I could not go beyond the command of the Lord my God, to do less or more. You remain here, as the others did, so that I may learn what more the Lord may say to me." That night God came to Balaam and said to him, "If the men have come to summon you, get up and go with them; but do only what I tell you to do." So Balaam got up in the morning, saddled his donkey, and went with the officials of Moab.