Image copyright AFP Image caption The helicopter, similar to this one, was en route to Russia for maintenance

Six crew members of a Pakistani helicopter that was forced to land in a part of Afghanistan where the Taliban are active have been released, Pakistan's foreign ministry says.

The five Pakistani crew and a Russian navigator made an emergency landing after a technical failure on 4 August.

They were transferred from Afghanistan to Pakistan at the border after what the foreign ministry called an "inter-tribe exchange".

They are said to be "in good health".

The crew were reported to have been taken captive by the Taliban, but the Pakistani government did not confirm this.

The Russian-built Mi-17, which belongs to the Punjab provincial government, was on its way from Peshawar to Russia where it was due to undergo maintenance. It came down in Afghanistan's Logar province.

The Pakistani, Afghan and Russian governments were all reported to be working to free the captive crew. The Afghan authorities are said to have made contact with tribal elders, suggesting they may have mediated the release.