I kill ... I wound ... I will make mine arrows drunk with blood, and my sword shall devour flesh. Deuteronomy 32:39-42
God starts planning this mass murder in Chapter 3 of Exodus, and he doesn't stop talking about it until he kills every Egyptian firstborn child (and animal) in Exodus 12.
Here was the way God planned it.
On the night of the mass child murder, God told each Israelite family to find a year-old lamb without blemish, kill it, and wipe the blood on the top and sides of the door.
In the tenth day of this month they shall take to them every man a lamb ... without blemish, a male of the first year ... And ye shall ... kill it in the evening. And they shall take of the blood, and strike it on the two side posts and on the upper door post of the houses. Exodus 12:3-7
That way when God came through Egypt looking for first born children and animals to kill, he would see the bloody door and "pass over" the house, saying to himself, "Oh yeah, I'm not supposed to kill any children or animals here."
For I will pass through the land of Egypt this night, and will smite all the firstborn in the land of Egypt, both man and beast ... and when I see the blood, I will pass over you, 12:12-13
And that's what happened.
At midnight God passed through Egypt killing every Egyptian first-born child and animal.
At midnight the LORD smote all the firstborn in the land of Egypt, from the firstborn of Pharaoh that sat on his throne unto the firstborn of the captive that was in the dungeon; and all the firstborn of cattle. 12:29
After God was done, there was not a single Egyptian house that didn't have one dead child.
And there was a great cry in Egypt; for there was not a house where there was not one dead. 12:30
Why did God do it?
Well, it seems that he did it to show off his signs and wonders,
I will ... smite Egypt with all my wonders. 3:20
I will harden Pharaoh's heart, and multiply my signs and my wonders in the land of Egypt. 7:3
Go in unto Pharaoh: for I have hardened his heart, and the heart of his servants, that I might shew these my signs before him. 10:1
The LORD said unto Moses, Pharaoh shall not hearken unto you; that my wonders may be multiplied in the land of Egypt. 11:9
To introduce himself to the Egyptians,
And the Egyptians shall know that I am the LORD. 7:5
To show what he can do,
Now shalt thou see what I will do to Pharaoh. 6:1
To show that there is nobody else on earth quite like him,
For I will at this time send all my plagues upon thine heart, and upon thy servants, and upon thy people; that thou mayest know that there is none like me in all the earth. 9:14
To make himself famous (so that everyone will know his name),
That my name may be declared throughout all the earth. 9:16
To give us a story to tell our children and grandchildren,
That thou mayest tell in the ears of thy son, and of thy son's son, what things I have wrought in Egypt. 10:2
To show that the whole earth belongs to him,
That thou mayest know how that the earth is the LORD's. 9:29
To prove that he is God,
In this thou shalt know that I am the LORD. 7:17
That ye may know how that I am the LORD. 10:2
To show that he likes Israelites more than Egyptians,
That ye may know how that the LORD doth put a difference between the Egyptians and Israel. 11:7
And to punish the Egyptian Gods.
Against all the gods of Egypt I will execute judgment. 12:12
Well, I guess those motives are about as good as any for a mass murder.
In any case, God is clearly proud of this one. And it's no wonder. It wasn't all that easy to pull off, even for God.
He had to harden the Pharaoh's heart eight times to make it all work out as planned.
I will harden his heart, that he shall not let the people go. Exodus 4:21
I will harden Pharaoh's heart. 7:3
He hardened Pharaoh's heart, that he hearkened not unto them; as the LORD had said. 7:13
The LORD hardened the heart of Pharaoh. 9:12
The LORD said unto Moses, Go in unto Pharaoh: for I have hardened his heart, and the heart of his servants, that I might shew these my signs before him. 10:1
The LORD hardened Pharaoh's heart, so that he would not let the children of Israel go. 10.20
The LORD hardened Pharaoh's heart, and he would not let them go. 10:27
The LORD hardened Pharaoh's heart, so that he would not let the children of Israel go out of his land. 11.10
Some hearts are hard for even the Bible god to harden.
So how many were killed in this killing? Well, the population of Egypt at the time the Exodus supposedly occurred was about 3 million [2]. If one-sixth of them were first born sons, a half million Egyptians were killed by God (or the angel sent by God to do his dirty work for him).