In this photograph taken on October 19, 2015 an Afghan security personnel searches commuters as others look on at a checkpoint in Maimana, the capital of the northern province of Faryab. Photo: AFP/Wakil KOHSAR

The Afghan army launched an operation Wednesday to rescue 18 hostages including two Moldovans captured by the Taliban after their helicopter crash-landed in the north, officials said.

The Taliban killed three of those on board -- two Afghans and a third foreigner -- in an initial firefight and took the rest hostage after the Tuesday crash, the defense ministry said in a statement.

The helicopter came down in the Pashtun Kot district of Faryab province, an area partly controlled by the militants.

The 21 people on board included two Moldovan pilots and a Moldovan engineer, the country's acting prime minister Gheorghe Brega told reporters in Chisinau.

He did not specify if the three were dead or captured, but the Afghan defense ministry said two foreigners were being held along with an unspecified number of Afghan soldiers.

The insurgents fought off an initial attempt Tuesday by the Afghan army to rescue the surviving hostages, the ministry said. It said a fresh attempt was launched Wednesday but gave no immediate details.

The helicopter was an Mi-17 that was privately owned by the Valan ICC company in Moldova, according to Brega, and had been chartered by the Afghan army.

It made an emergency landing "due to technical reasons" near Maimana, the capital of Faryab province, the defense ministry statement said.

"Later they encountered battle with the enemy. As a result, two army soldiers and one foreign national were killed and 18 others on board arrested by armed opponents of the government," it said, without specifying whether all the Afghans on board were soldiers.

Afghan sources had previously put the number being held at 15.

In a statement on its website Wednesday the Taliban claimed it had shot the helicopter down. The insurgents are known to make exaggerated battlefield claims.

The Taliban said the militants had killed five people and were holding a further 15, and made no mention of any foreign hostages.

It claimed the captives had "been taken to safe areas and are being investigated".

Moldova does not have a diplomatic mission in the war-torn country and its foreign ministry requested assistance from the United Nations, while Brega said his country had appealed to the US for help.

The US-led NATO coalition, which has 13,000 foreign troops in the country, has not yet commented on the incident.

Faryab province has in recent months been the scene of bitter fighting between Afghan troops and police and Islamist insurgents, who are increasingly active in northern Afghanistan.

In late September the Taliban temporarily seized control of the provincial capital of Kunduz -- the first time the group had taken control of a major city since being toppled from power in 2001.

Galvanized by the brief conquest, they launched assaults on other cities including Maimana, but were pushed back by heavily armed local residents, while local security forces reportedly abandoned their posts.

The Taliban have in the past shot down several military helicopters with small-arms fire.

In October a US F-16 was struck by enemy fire in eastern Afghanistan, in a rare case of an advanced fighter jet coming under a Taliban-claimed attack.