Exodus 13:15

15 and it came to pass, when [the Speech of Yahweh] hardened [Pharaoh's heart] against letting us go, that Yahweh slew all the firstborn in the land of Egypt, from the firstborn of man to the firstborn of beast: therefore I sacrifice to Yahweh all that opens the womb, being males; but all the firstborn of my sons I redeem.