Exodus 13:15

15 When Pharaoh refused to let us go, the LORD killed all the oldest offspring in the land of Egypt, from the oldest sons to the oldest male animals. That is why I offer to the LORD as a sacrifice every male that first comes out of the womb. But I ransom my oldest sons.'