Diplomatic immunity dates back to ancient times, although it was only codified as an element of international law by the Geneva Convention on Diplomatic Relations of 1961. The Romans, ancient India, even the Mongols practiced diplomatic immunity. The Mongols in particular took terrible revenge on those who were so vile as to "shoot the messenger." The immunity of the diplomat was considered an expression of honor to the sovereign whom he represented. To deny him immunity was to dishonor his sovereign.
During the early modern age, diplomats were quite often not hired professionals but might be relatives of the sovereign whom they represented. Even in the event of war, it was commonly accepted that war was between nations, not the individuals, and there was therefore nothing to be gained by refusing to extend courtesies to the person representing the foreign government. As early as 1709, the British Parliament passed acts guaranteeing immunity for foreign representatives.