Pakistan's foreign secretary summoned the Indian High Commissioner Thursday to say the government would be expelling a diplomat.
"The Foreign Secretary expressed deep concern over the activities of the Indian official that were in violation of the Vienna Convention and the established diplomatic norms," a statement said, naming the official as Surjeet Singh.
New Delhi also announced Thursday it was expelling a Pakistani visa official for suspected spying, with Islamabad responding by saying it would send back an Indian diplomat in an apparent tit-for-tat move.
The expulsions come as tensions between the nuclear-armed neighbours are running high over their disputed territory of Kashmir.
New Delhi police said the Pakistani official had been recruiting Indian nationals for two and a half years to spy for Pakistan's powerful Inter-Services Intelligence (ISI) in return for cash.
"Delhi police crime branch has busted an espionage racket run by a kingpin working in the Pakistan high commission," said Ravindra Yadav, joint commissioner of police on crime.
The official, named as Mehmood Akhtar, was detained on Wednesday with documents in his possession on Indian troop deployment along the border, Yadav told a press conference in Delhi.
"They used to meet once in a month at a pre-decided place to exchange documents and money," he said.
Akhtar was later released, he added.
India's foreign secretary Subrahmanyam Jaishankar summoned Pakistan's high commissioner to inform him of the decision to expel the official within 48 hours.
"FS (foreign secretary) summons Pak High Commissioner to convey that Pak High Commission staffer has been declared persona non grata for espionage activities," Indian foreign ministry spokesman Vikas Swarup said on Twitter.
Pakistan's foreign secretary then summoned the Indian High Commissioner on Thursday night to say Islamabad would also be sending back a diplomat over alleged improper activities.
"The Foreign Secretary expressed deep concern over the activities of the Indian official that were in violation of the Vienna Convention and the established diplomatic norms," an official statement said. It named the official as Surjeet Singh and added he and his family would also be required to leave within two days.
Tensions between India and Pakistan have soared since a raid last month on an Indian army base near the de-facto border dividing Kashmir killed 19 soldiers, the worst such attack in more than a decade.
India blamed militants in Pakistan and said it had responded by carrying out strikes across the heavily-militarised border, although Islamabad denies these took place.
'Spies' to meet at zoo
Yadav said two Indian nationals from the northern state of Rajasthan were also arrested, and that Akhtar had planned to meet his Indian co-conspirators at the Delhi zoo to exchange the information and cash.
He said Akhtar was carrying maps that showed the deployment of India's Border Security Forces (BSF) and army soldiers.
"A list of jawans (soldiers) posted at the border along with soldiers who had retired from service was also recovered," Yadav said.
Another Indian national was arrested late Thursday from the western Jodhpur city on charges of helping the Pakistan official, a senior police officer said.
Pakistan's High Commissioner Abdul Basit lodged a "strong protest" on Thursday with the Indian foreign ministry and said the detention of the official contravened diplomatic conventions, a Pakistani diplomatic source said.
The expulsions came as two Indian soldiers died on Thursday during two separate gunfire incidents on the border with Pakistan in Kashmir region.
Such incidents have increased in recent months as relations between the rivals have plummeted.
Indian Prime Minister Narendra Modi has warned Pakistan since the army base attack that India would push to make it a pariah state, accusing it of being a "mothership of terrorism".
Tensions were already high before the attack, with deadly violence in Kashmir over the death on July 8 of a popular militant leader.
Nearly 90 people, most of them young protesters, have been killed in clashes with security forces in Indian-administered Kashmir.
Indian and Pakistani troops regularly exchange fire across their de-facto border in Kashmir, but rarely send ground troops over the line. Muslim-majority Kashmir has been divided between India and Pakistan, but claimed in full by both, since the two countries gained independence from Britain in 1947. Since 1989, Kashmiris have been fighting Indian forces deployed in the region, seeking independence or a merger of the territory with Pakistan.
Since the dispute of Kashmir, one of the oldest disputes on the agenda of the UN Security Council along with that of Palestine erupted in 1947 between India and Pakistan, more than 94,000 Kashmiris have been killed during clashes, according to Pakistani officials' reports.