It likely isn't the first example, but an interesting ancient manifestation of genocidal behavior can be found in Deuteronomy 20:16-17:
However, 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. (NIV)