Deuteronomy 21:10

When thou goest forth to war against thine enemies, and the Lord thy God hath delivered them into thine hands, and thou hast taken them captive,

Cross-reference

In Deuteronomy 20:10-16, rules for distant cities include taking captives — the immediate legal context for 21:10's captive law.

In Numbers 31:18, Israel spares virgin girls as captives from Midian — a concrete example of the general captive-taking principle.