Story highlights

NEW: The chopper strayed due to inclement weather, an Indian government spokesman says

NEW: "We greatly appreciate" how Pakistan handled the incident, spokesman says

"The matter has been resolved," a Pakistani military spokesman says

Copter landed near northeast Pakistan's Skardu district in bad weather

CNN  — 

Pakistani officials said they forced an Indian Army helicopter to land Sunday after the aircraft violated Pakistani airspace.

Four officers of the Indian Army were taken into custody but later released, Pakistan’s military spokesman General Athar Abbas told CNN sister network CNN-IBN.

“All the Indian crew members have been released and they are on the way to India and the matter has been resolved,” Abbas said.

An Indian military spokesman said the helicopter and its crew had returned to India Sunday afternoon.

“It has been sorted out,” defense spokesman Sitanshu Kar said,.

Indian external affairs ministry spokesman Vishnu Prakash said the chopper strayed from its course into Pakistan-administered Himalayan territory due to inclement weather.

“We are relieved that our officers and helicopter are back in India. We greatly appreciate the manner in which Pakistan worked with us in resolving the matter,” he said.

The helicopter landed near Skardu, a district in northeast Pakistan, Pakistani military officials said.

The nuclear-capable neighbors have fought three wars since the partition of the Asian subcontinent in 1947, two of them over Kashmir, which both nations claim.

Earlier this year, New Delhi and Islamabad agreed to resume peace talks frozen by the 2008 Mumbai terror attacks. India blamed Pakistani militants for the strike on its financial capital, which killed more than 160 people.

In July, both nations vowed they would not allow their relationship to slide backward again.

In 2004, the nations agreed to negotiations that cover eight issues, including Kashmir, terrorism and Pakistan’s concerns over river dams on the Indian side of the border, which it sees as a threat to its water supplies.

Journalist Nasir Habib and CNN’s Harmeet Shah Singh contributed to this report.