Diplomatic immunity has long been a staple of good-faith diplomatic relations between governments in the modern state system. But although the privilege was designed to reduce the incidence of conflict between states, its abuse has often had the opposite effect.

The 2013 New York arrest of Indian diplomat Devyani Khobragade triggered a diplomatic rift between Washington and New Delhi. Charged with visa fraud and perjury, Khobragade was also accused of violating U.S. labor law by underpaying her housekeeper while making her work longer hours.

At the time, many Indians expressed outrage at the treatment the diplomat received upon her arrest, which included a strip search. However, U.S. Attorney Preet Bharara defended the federal government’s conduct, claiming that Khobragade had been “accorded special courtesies” because of her diplomatic status. Khobragade claimed that she was “cloaked in diplomatic immunity at the time of her arrest” and left the United States for India in January.

Less than a year later, a similar diplomatic standoff has occurred, this time involving Malaysia and New Zealand.

Last May, New Zealand officials charged Muhammad Rizalman Ismail, a defense staff assistant with the Malaysian High Commission in New Zealand, with committing burglary and sexually assaulting a 21-year-old woman. Much like Khobragade, Rizalman flew back to his country of origin and claimed diplomatic immunity.

But the similarities between the two cases end there. The latest reports indicate that Malaysia has promised to extradite Rizalman back to New Zealand to face his charges, although it is unclear when this will happen. The diplomat is still in a Malaysian military hospital undergoing psychiatric evaluations for depression.

The incident has caused an uproar in both Malaysia and New Zealand, where citizens on both sides of the divide have criticized their respective governments over the handling of the case.

Many Malaysians condemned the government’s decision to retain Rizalman’s diplomatic immunity in light of the heinous crimes he stands accused of. Datuk Seri Anifah Aman, Malaysia’s minister of Foreign Affairs, responded by saying that New Zealand officials had allowed the defense officer to return to Malaysia and even offered him the option of invoking diplomatic immunity.

Anifah’s version of the affair did not hold for very long, however. On July 1, New Zealand’s Ministry of Foreign Affairs released documents contradicting Anifah’s claims and confirming that New Zealand had, in fact, requested that Malaysia waive Rizalman’s immunity. Malaysia refused, asking that the charges be dropped and the matter be swept under the rug.

New Zealanders have also condemned their government’s failure to ensure that Rizalman stood trial for his crimes. Tania Billingsley, the woman at the center of the affair, has spoken out against the “poor mismanagement” of her case. More interestingly, even as it fired back against Anifah, the New Zealand government has admitted that it might have given Malaysian authorities the impression that Rizalman could invoke diplomatic immunity and return to Malaysia. There is now a growing call for New Zealand Foreign Minister Murray McCully to resign from his position due to his role in the matter.

In both incidents, public pressure impacted how the situation played out. In Khobaragade’s case, Bharara lamented the fact that the Indian public was more outraged at how the diplomat was treated than the crime she committed. The federal government indicted Khobragade again in March on the same charges. She faces arrest should she ever return to the United States, which is unlikely since India has refused to revoke her immunity.

Malaysia and New Zealand have responded more appropriately to the public’s sharp criticisms, thereby avoiding the mistakes the United States and India made last year. All that’s left to do now is to pay for Rizalman’s ticket to New Zealand.

Latifah Azlan is an intern at Foreign Policy in Focus.