This practice was continued by the Rashidun caliphs who exchanged diplomats with the Ethiopians and the Byzantines.
This diplomatic exchange continued during the Arab–Byzantine wars.
In such cases, the servants of the "criminal" sovereign were often considered accomplices and their persons violated.
Many principles of diplomatic immunity are now considered to be customary law.
Diplomatic immunity as an institution developed to allow for the maintenance of government relations, including during periods of difficulties and armed conflict.
On the other hand, during World War II, diplomatic immunity was upheld and the embassies of the belligerents were evacuated through neutral countries.
For the upper class of the 17th, 18th, and 19th centuries, diplomatic immunity was an easy concept to understand.
When receiving diplomats, who formally represent the sovereign, the receiving head of state grants certain privileges and immunities to ensure they may effectively carry out their duties, on the understanding that these are provided on a reciprocal basis.