Is murder allowed if God tells you to do it? The Bible pretty clearly says not to murder (Exodus 20:13).

But if we examine Numbers 25 or 1Kings 18:40, we see God (or more accurately, his prophets) telling us to kill people.  Indeed, entire groups of people were murdered because of their mistaken beliefs.

So, is it alright to murder if God or one of his prophets tells you to?

I would think that this concept against murdering would be against all Christian doctrine.  However, how does the mainstream Protestant groups (Baptist, Episcopalian, Methodist, Lutheran, etc.) reconcile these two concepts?
Murder and killing are not necessarily the same thing. The King James Bible adds confusion to this debate by translating Exodus 20:13 as:


  Thou shalt not kill.


Which historically has been interpreted to mean a commandment against all forms of killing, including capital punishment, war, and in some cases, even against killing animals.  In the context of the rest of the Law, this is clearly not what was meant. (See especially Leviticus 20).

The same holds for your examples--they are examples of killing, but that does not mean they are examples of God-ordained murder.



EDIT

In response to Richard's comment below:

According to dictionary.com, the relevant definition of murder is:


  Law. the killing of another human being under conditions specifically covered in law. In the U.S., special statutory definitions include murder committed with malice aforethought, characterized by deliberation or premeditation or occurring during the commission of another serious crime, as robbery or arson (first-degree murder),  and murder by intent but without deliberation or premeditation (second-degree murder).


So here, legal killing is differentiated from illegal killing, and it is only illegal killing that is "murder."

In ancient Israel, since God was the giver of all laws, then any God-ordained killing (whether in the form of the Law, as I mentioned previously in Leviticus, for example), or by way of his prophets, would be "legal", and therefore not murder.

It may sound a bit like a cop-out, but in a nut shell, "If God says to do it, it's not murder." It can probably be boiled down to a question of "Where does morality come from?" But that's obviously not the specific intent of this question. :)

Numbers 35:16,  35:18, and 35:21 also provide Biblical examples or definitions of a "murderer".