1 Samuel 15:3. KJ21. Now go and smite Amalek and utterly destroy all that they have, and spare them not; but slay both man and woman, infant and suckling, ox and sheep, camel and ass.’”
Deuteronomy 20:16-17, God commanded the Israelites, “In the cities of the nations the Lord your God is giving you as an inheritance, do not leave alive anything that breathes. Completely destroy them—the Hittites, Amorites, Canaanites, Perizzites, Hivites and Jebusites—as the Lord your God has commanded you.”
That was the Lord’s command.
But they didn’t do it. For example, Haman was reputed to be an Amalekite.
The Jebusites were also not destroyed, but kept as slaves. And perhaps others of that group as well.