Diplomatic immunity is a practice that protects diplomats from prosecution by the legal authorities of the country in which they are stationed. Such protection is needed to allow diplomats to avoid harrassment or penalization that may result from innocent lack of knowledge or understanding of local customs and laws. Diplomatic immunity is not permission to commit crime in a foreign country, but it is recognition that circumstances may need to be viewed differently for a diplomat than for a resident of a given country.
Diplomatic immunity may be used to excuse violations of laws in a diplomat's host country. For example, "In February 1995 Mayor Rudolph Giuliani of New York City forgave $800,000 in parking tickets accumulated by foreign diplomats." Diplomatic immunity is often cited in cases where rental of diplomatic offices or residences for diplomats has gone unpaid. Diplomatic immunity may be claimed as a factor in divorce or custody negotiations if one of the adult parties to the dispute is a diplomatic employee.