Eden Fernandez, 28, who went to Afghanistan in 1989 and converted to Islam, was released by the Shi'ite Muslim faction Hezbi-e-Wahadat which had held him for eight months, claiming that he had sent reports to British intelligence.
The faction's leader, Abdul Ali Mazari, handed Mr Fernandez, from St Ives, Cambridgeshire, over to Stephen Evans, a British diplomat based in Islamabad, Pakistan, who was visiting Afghanistan. No ransom demand was made.
A spokesman for the Foreign Office said: "We are delighted that Mr Fernandez has been released. It would not have been possible if Stephen Evans had not been visiting. It is also due in large part to the readiness of Mr Mazari to agree on humanitarian
grounds to the release."
Mr Evans, who is first secretary at the British high commission in Islamabad, was visiting Kabul with three colleagues. He firmly rejected the spying charge against Mr Fernandez. "The British government refutes being involved in anything that may undermine Afghanistan or the Afghan people, but welcomes the release of Mr Fernandez as a goodwill gesture," he said.
Mr Fernandez's mother, Janice, heard of the impending release on Thursday. She said yesterday that she would "only feel happy when he is here". The former punk rocker had lost contact with his family, who did not even know he had been captured until recently. Mr Fernandez had been fighting for a guerrilla faction supporting President Burhanuddin Rabbani in the civil war which has been raging since the overthrow of the communist regime in Kabul. He was captured last May. As a foreigner involved in the conflict he risked execution.
Yesterday he was undergoing medical checks. The Foreign Office said he would stay in Kabul at the former British Embassy compound before travelling on to Peshawar and Islamabad today. It is not yet known when he will return to England.
Britain, like most other western countries, has no diplomats permanently based in the war-ravaged Afghan capital because of the risk to staff. Thousands of people have been killed in artillery and rocket attacks on Kabul as shifting alliances of rival groups struggle for control of the country.