In Genesis, we see a motif of first-born sons being overly aggressive and ambitious. Kain slays Abel out of a jealous wrath. Firstborn Esau and Jacob have a long-running rivalry that ends with Jacob fleeing in fear of his life. Jacob's fear of Esua is so great that 20 years do not diminish it. Rueben attempts to usurp his father's authority by sleeping with the concubines.
At other times, the slights on the firstborn are more subtle. When Jacob/Israel blesses the sons of Joseph, he intentionally chooses the younger to receive the blessing. Genesis even points out that this was unexpected and displeased Joseph.
The theme culminates in the final plague of the Exodus when God slays the first born of Egypt. Shortly thereafter, God gives the commands for how the people are to live in the Land. One of those commands is quite surprising in light of the rest of the Bible. Exodus chapter 22:28 (with leading and trailing context) is not ambiguous:
You will not curse God, and a prince of your people, you will not smear. For your goods and your wine-pressings do not be late, your eldest son offer to me. Thus you will do for your oxen and your sheep: seven days it will be with its mother, on the eighth day, give to me. And a holy people thou shalt be to me, and predated carcasses in the field you will not eat, you shalt throw it to the dogs.—Exodus 22:27-29 (Wikiproject Wiki Bible, emphasis added)
The context makes "give to me" clear—it means sacrifice. Placed parallel with "offer," this is a call for child sacrifice. Although this interpretation is, of course, impossible in the context of the rest of the Bible. However, child sacrifice is documented in the religions of the Ancient Near East.
However, later on in Exodus, one reads:
All that breaks opens a womb, and all your livestock remember, first birth a bull and a sheep. And first birth of donkeys you will redeem with a sheep, and if you will not redeem it, break its neck. All your firstborn sons, redeem, and they will not see my face devoid of these.—Exodus 34:19-20 (Wikiproject Wiki Bible)
The call is to kill all that is firstborn of animals. The exceptions are donkeys, which one may redeem with a sheep, and sons which must be "redeemed." One can interpret this verse as saying that an animal sacrifice must be substituted for a human male.
Does Exodus 22:28 call for killing firstborn sons in ritual child sacrifice?