King Balak of Moab, fearing the Israelites, hired Balaam to put a curse on them, but God told Balaam he must only do what He commanded. As Balaam traveled, an angel blocked the path; when Balaam beat his donkey for stopping, God enabled the donkey to speak and rebuke him. Balaam eventually learned that he could only speak the words God put in his mouth, which resulted in him blessing the Israelites instead of cursing them.