Russia has agreed to return to the war in Afghanistan at the request of the Western states which helped the mujahedin to drive its forces out of the country 21 years ago.

The Independent has learnt that Moscow is engaged in training the Afghan army and counter-narcotics troops and has agreed in principle to supply Nato with several dozen helicopters for use in Afghanistan.

A number of aircraft have already been sold to Poland, a member of the US-led coalition, for use in the conflict. Now Nato is in talks with the Russians over direct supplies of more helicopters, training the pilots, and allowing arms and ammunition to be transported through Russian territory as an alternative to a Pakistani route which has come under repeated Taliban attack.

A groundbreaking agreement with Russia on the issue is likely to be announced at the Nato summit next month in Lisbon, which is due to be attended by President Dmitry Medvedev.

In return for help in Afghanistan Moscow is seeking what it terms as more co-operation from Nato. President Barack Obama has already scrapped missile-defence shields in Poland and the Czech Republic, proposals for which had led to prolonged protests from Moscow, and Nato has agreed that Russia will be consulted on the replacement system.

Moscow would also like Nato to accept a fait accompli over Georgia, where Russian troops remain in South Ossetia and Abkhazia after the war of two years ago. American and European officials maintain that the occupation of a member state's sovereign territory is not a matter for compromise.

The helicopters are needed for the use of Afghan forces which Isaf (International Security and Assistance Force) is training to take over security as part of the West's exit strategy from the war.

It was the supply of American Stinger missiles by US and British intelligence to Afghan rebels, enabling them to shoot down Russian helicopters, which changed the course of the Soviet war in Afghanistan and helped to hasten the collapse of the Communist government in Moscow.

That war, with its acts of brutality committed by both sides, has left bitter memories among many in the country, and the news that the Russian military is playing a part in the war is likely to be exploited by the Taliban.

The former Cold War enemies have been drawn together by the common threat of Islamist terrorism, some of it directly spawned from Western aid to jihadists in the 1980s.

Moscow is also concerned about a flow of heroin through central Asia to its cities from Afghanistan. And it urgently wishes to reassert its influence in the region.

The Nato secretary-general, Anders Fogh Rasmussen, asked for helicopters during a visit to Moscow last year. "Russia has reflected on that and there are now bilateral talks between Russia and the United States on such helicopters," Mr Rasmussen said on Monday in Brussels. He added that he "would not exclude that we could facilitate that process within the Nato-Russia Council", a body which acts as a discussion forum with Moscow.

Russian and Western defence sources told The Independent that Moscow has provided five Mi-17 military helicopters to Poland for Afghanistan, with the first two to be delivered by the end of the year.

Afghan military officers are already being trained in a number of Russian defence institutes, according to the Russian deputy foreign minister Aleksander Grushko. Mr Grushko underlined that Moscow wanted a binding mutual restraint agreement with Nato and an agreement to delink the Georgia crisis from an arms treaty. He added: "We are ready to co-operate with Nato, because we think we are doing a common job."

Anatoly Serdyukov, who became the first Russian defence minister to visit the Pentagon where he met the US Defence Secretary, Robert Gates, last month, said that Russia was willing to sell or lease Mi-17s for use by Afghan forces, and will countenance similar deals with Nato member countries.

"It is a matter of several dozen Mi-17s that Nato will purchase from us," Mr Serdyukov said.

"I hope that Western peacemaking troops will not withdraw before they have fulfilled their mission. We are watching things in Afghanistan very closely and we are exchanging our experience with the Americans. Russia is ready to pass on to America the experience gained by our veterans of the war in Afghanistan.

"Withdrawal of the [Western] troops would naturally affect the situation in central Asia, we currently cannot even imagine how. For this reason we want to help the West, among other things with helicopters, whose delivery we are now discussing."

Securing new supply routes for Nato forces in Afghanistan – which now number more than Russian troops during their war – has become urgent for the West with attacks on convoys in Pakistan by insurgents, some of which, claim Western officials, are instigated by members of the Pakistani military and intelligence service.

Russia allows some movements of supplies along its territory, but restricts the types of weaponry being moved. Nato would like this removed. According to defence sources, Moscow has indicated that it may agree to this after carrying out security checks along the route, which starts at the all-weather Latvian port of Riga and arrives in Afghanistan through Russia, and the former Soviet territories of Kazakhstan and Uzbekistan.

Russia's changing role

July 1979 Operation Cyclone launched by the CIA, using US and Saudi money and help of the Pakistani military regime to start arming the mujaheddin.

December 1979 Soviet intervention at request of Afghan government. Moscow falls out with President Hafizullah Amin, his palace in Kabul is attacked and he is killed.

March 1980 to April 1985 Soviet forces begin offensives, especially near the Pakistani and Iranian borders. US and British supply Stinger missiles enabling mujaheddin to shoot down Russian helicopters. New Soviet General Secretary Mikhail Gorbachev increases troop levels to 110,000.

April 1985 to January 1987 Russian exit strategy based on training up Afghan security forces to take on insurgency. Rebels are still aided by the West.