In Judges, chapter 11, the military leader Jephthah made a bargain with God that, if God would guarantee Jephthah's victory over the Ammonites, Jephthah would, without fail, sacrifice as a burnt offering 'whatsoever cometh forth of the doors of my house to meet me, when I return'.
Jephthah did indeed defeat the Ammonites ('with a very great slaughter', as is par for the course in the book of Judges) and he returned home victorious. Not surprisingly, his daughter, his only child, came out of the house to greet him (with timbrels and dances) and - alas - she was the first living thing to do so. Understandably Jephthah rent his clothes, but there was nothing he could do about it. God was obviously looking for-ward to the promised burnt offering, and in the circumstances the daughter very decently agreed to be sacrificed. She asked only that she should be allowed to go into the mountains for two months to bewail her virginity. At the end of this time she meekly returned, and Jephthah cooked her. God did not see fit to intervene on this occasion.
-- Richard Dawkins, The God Delusion