Problem: The oracle of Balaam makes reference to the exaltation of Israel over Agag and his kingdom. However, Agag was an Amalekite king during the time of Saul who was king of Israel in the 11th century, almost 400 years later. How could this oracle refer to Agag when he lived later in the time of Saul?
Solution: First, the name Agag was probably a royal title which the Amalekite kings took for themselves—comparable to the title Pharaoh. The Amalekite king whom Saul would later defeat would have taken this title also.
Second, if Agag was a proper name, it is not necessary to conclude that the reference in Numbers is anachronistic. It was not uncommon for kings to have the same name as previous kings. Even in the history of Israel there were two kings with the name Jeroboam. This practice was common in Phoenicia, Syria, and Egypt. In Egypt there were four Pharaohs named Amenemhet in the 12th Dynasty alone.
Third, since the oracle of Balaam was given to him by the Spirit of God, it is possible that this is a prophetic announcement of the dominance which Israel would have over those people who were the first to attack them upon their departure from Egypt (Ex. 17:8ff). In any case, this reference is not anachronistic.
Other examples of so-called “premature mention” can be explained in similar ways. For example, the Amalekites may be mentioned by historic anticipation (in Gen. 14:7), even though they flourished much later (cf. Num. 13:29; 14:25; Jud. 6:3). Likewise, “the land of the Hebrews” (Gen. 40:15) could have been so named by anticipation of later fulfillment of God’s promise (in Gen. 12:1–3; 15:4–7) or by the fact that Abraham and his descendants had already lived there for centuries. Hebron (Gen. 13:18) may have been its original name, later called Kirjath-Arba, and then replaced again by Hebron (Josh. 14:15). Or, a later editor of the OT manuscript may have simply updated the name, so that the people of his day would understand the place to which it referred. For example, one of the present authors was born in a city then called Baseline, Michigan but was no part of Warren, Michigan. When asked by people today about the city of his birth, he generally says “Warren,” even though that was not its name at the time. Also, the Levite’s land (Lev. 25:32–34; Num. 35:2–8) was probably mentioned by way of anticipation. And the “mountain” where the “sanctuary” of the Lord was (Ex. 15:13–17) was simply speaking about the way it would be when they got into the Land of Promise.