A Foreign Ministry statement said both countries had "mutually agreed" to resolve matters related to the treatment of diplomats in line with the 12-point code of conduct signed in 1992.
In this agreement, both countries had decided, among other steps, not to carry out intrusive and aggressive surveillance of the diplomats, chasing their cars or harass each other. "The inviolability of the official/private vehicles, duly registered in the name of the mission and diplomatic/consular personnel shall be respected," it says.
In case of breach of code, the agreement required an intimation to be sent to the high commission before lodging a formal protest. Once a country did so far as to file the protest, the other side was required to probe the complaint and take steps to rectify the situation.
"Both sides shall exercise restraint to avoid unnecessary escalation," the pact says.
The cases of alleged harassment made headlines this month when Pakistan went public with complaints of alleged harassment of its diplomatic staff and their family in the national capital, a move that was seen as an attempt to embarrass New Delhi. It next attempted to escalate the issue by declaring that it was summoning High Commissioner Sohail Mahmood for consultations in light of these incidents.
India had responded angrily, pointing how Indian diplomats in Islamabad too had been facing "tremendous harassment for long, particularly in the last year" but had chose to tackle the matter with "quiet and persistent diplomacy".
Sources had later detailed numerous incidents where Indian diplomats were chased and abused in public places, reportedly by personnel of Pakistan's security establishment.
Get the latest election news, live updates and election schedule for Lok Sabha Elections 2019 on ndtv.com/elections. Like us on Facebook or follow us on Twitter and Instagram for updates from each of the 543 parliamentary seats for the 2019 Indian general elections.