Judges 20:39

And when the men of Israel retired in the battle, Benjamin began to smite and kill of the men of Israel about thirty persons: for they said, Surely they are smitten down before us, as in the first battle.

As the men of Israel withdrew in the battle, Benjamin began to strike down and kill about thirty Israelites, concluding that Israel was surely smitten down before them as in the first battle. That withdrawal was not a real defeat but a planned retreat, which Benjamin misread as another defeat like the first. Benjamin therefore only seemed to be winning again at this point, for Israel had been twice repulsed yet was finally victorious. The battle to which this moment belongs nearly wiped out the tribe of Benjamin.

The verse belongs to the account of the crime at Gibeah, the murder of the Levite's concubine and the ensuing conflict, in which the tribe of Benjamin sided with and identified itself with the people of Gibeah. The events in chapters 17 through 21 occurred early in the history of the judges, even though they are placed after chapter 16, where the main story of the book ends.

The verse belongs to a record of Israel's backsliding and its resulting disgrace and punishment, showing that sin is never excused. The last chapters of Judges to which it belongs show the low state into which Israel had fallen before the call of Samuel the prophet. The episode is presented as part of the record of Israel's fearful backsliding and of God's great mercy and goodness. God may allow His people to suffer apparent defeat for a time to humble their self-confidence and lead them to rely on Him, and when they turn to Him distress can give way to joy and success.