What is the origin of the phrase don't shoot the messenger?

The advice "Don't shoot the messenger" was first expressed by Shakespeare in Henry IV, part 2 (1598)[citation needed] and in Antony and Cleopatra[1] (1606-07). Prior to that, a related sentiment was expressed in Antigone by Sophocles as "No one loves the messenger who brings bad news."[1]. An analogy of the phrase can come from the breaching of an invisible code of conduct in war, where a commanding officer was expected to receive and send back emissaries or diplomatic envoys sent by the enemy unharmed. During the early Warring States period of China, the concept of chivalry and virtue prevented the executions of messengers sent by opposing sides.

Courtesy of Wikipedia