SRINAGAR, India (AP) — Indian authorities detained and later released two key Kashmiri separatist leaders Thursday ahead of talks between Indian and Pakistani security advisers, while a third remained under house arrest.

The detentions came days before the leaders were expected to travel to New Delhi at the invitation of Pakistan's ambassador to meet with Sartaj Aziz, national security adviser to Pakistan's prime minister.

Aziz is set to arrive in New Delhi on Sunday to talks with his Indian counterpart Ajit Doval that are expected to focus on terrorism.

The meeting signals the resumption of dialogue between the two countries a year after India canceled talks between the foreign secretaries of the two countries, and after Pakistan consulted Kashmiri separatists. In July, Indian Prime Minister Narendra Modi and Pakistan's Nawaz Sharif agreed on the sidelines of a summit in Russia to arrange such a meeting.

On Thursday, police put separatist leader Mirwaiz Umar Farooq under house arrest and whisked Mohammed Yasin Malik to a police station in Indian Kashmir's main city of Srinagar. Both were released after about two hours.

"We were directed to detain them and we did that. Later we were ordered to release them and we did that too," said a police officer, speaking on condition of anonymity because he was not authorized to speak to reporters.

However, police did not remove barricades from outside the home of separatist leader Syed Ali Geelani.

Farooq expressed surprise over the detentions and quick release and said the Indian government was "confused" ahead of the talks. He said the aim of their visit to New Delhi was "supporting the India and Pakistan dialogue."

Kashmir's former top elected official and opposition leader Omar Abdullah criticized both India and Pakistan in a tweet, saying the two countries were "competing to give reasons to call off talks."

"I've never seen an Indo-Pak dialogue where both sides are so keen to sabotage it," he said.

The hostility between Pakistan and India dates back seven decades, but strains have grown since Modi, a Hindu nationalist, took office a year ago. Skirmishes between Indian and Pakistani troops in the disputed region of Kashmir have also increased in recent months.

The fighting has followed a familiar pattern, with each side blaming the other. In the last week, at least nine civilians were killed and scored injured on both sides of the territory, which is divided between India and Pakistan but claimed by both. They have fought two of their three wars over Kashmir.

Noor Mohammed Baba, who teaches political science at the Central University of Kashmir, said it was too early to say if the separatist leaders would actually be allowed to meet the Pakistani official. There's been no word from Indian officials.

"Both sides want to have talks only on their own respective agendas," he said. "Militancy is again on the rise and the borders have become hot. There is a dire need for the two countries to adjust their positions to avert death and destruction in the region."