Immediately after the last Baddie or Gearloc is defeated.

There may be special victory circumstances on an Encounter Card that differ from this, but generally a Battle is successfully won and ends, as soon as the last Baddie falls. When fighting Tyrants, the Battle ends as soon as the Tyrant is defeated, even if Baddies remain.

Alternatively, a Battle immediately ends in defeat when the last Gearloc on the board is KO'd.