King Pyrrhus of Epirus (present day NW province of Greece and partly in SE Albania) brought his army to assist the Greek city of Tarentum in southern Italy against the Romans. He fought two battles against them and won each, but lost many of his friends and his best troops, whom he could not replace; the Romans each time recruited more soldiers from their ample supply of manpower from themselves and their Latin allies.
On being congratulated after the second victory he said 'One more victory like that and I am completely undone'. Hence his name is used to describe a victory where the cost far outweighs the gain.