The Vienna Convention on Diplomatic Relations, a treaty to which almost every country in the world is a party, provides that diplomats enjoy immunity from arrest, criminal prosecution and civil lawsuits in the countries where they are posted. Diplomatic immunity is vital to protect the more than 15,000 American diplomats serving in over 150 countries from political and legal harassment. If American diplomats did not have immunity, they would be at constant risk of detention and prosecution on trumped-up charges, especially in countries where the United States is unpopular or where the government bows to popular pressure.
Foreign diplomats and certain representatives of international organizations serving in the U.S. also enjoy immunity. Unfortunately, this means that if they commit crimes like driving while drunk or abusing household workers, they have immunity from prosecution or lawsuits in U.S. courts. But the federal government is not totally without recourse. For serious crimes, the State Department may press the foreign government to waive immunity, and in some cases the foreign government may be willing to do so. If the foreign government refuses, then the State Department may ask the government to recall the diplomat, or may expel the diplomat from the U.S.