Of course you need to have won the battle.

If not, then the enemy just receives their prisoners back (I would have loved to be able to kill them off if it looked like you were loosing like in MTW).