when they Israelites came out of egypt, God stated that the firstborn males and animals were to be dedicated to him, not sacrificed. Nations around were sacrificing to false gods one named Molech, ws disgusting to God due to the child sacrifices Lev 20:2 and the Israelites were warned many times not to throw their children into the fire. There are at least 8 scriptures in KIngs that decry this practise . Go to search and enter Molech.
This sanctification to God for the firstborn males was not sacrifice as Molech, but something akin to service and loyalty to God.