By Kate Clark
BBC News, north-west Pakistan
Some UN relief money was channelled through charities associated with extremist jihadi groups in the wake of the 2005 Pakistan earthquake, a BBC investigation has found.
Money from the UN and others poured in to help victims
The quake killed 79,000 people, and left 11,000 children orphaned last October. More than two million people lost their homes.
The BBC has discovered that one of the charities linked with extremists is now using its position to gain access to orphaned or fatherless children.
In the days following the catastrophic earthquake, the government of Pakistan promised that all such children would be looked after either by their extended family or the state.
It is difficult to imagine the scale of the destruction last October. Many of the survivors told me they thought it was the end of the world - literally.
There followed a mass mobilisation by ordinary Pakistanis, non-governmental organisations and Muslim groups to help the survivors.
Various charities associated with militant groups also responded.
They included the al-Rashid Trust, which is banned by the UN Security Council and accused of being a conduit for al-Qaeda financing.
The group is also on Pakistan's own terrorism watch list.
But the UN on the ground delivered aid to relief camps controlled by al-Rashid - tents, trucks, medicine, blankets and schools.
UN agencies also worked with Jamaat ud-Dawa, another charity which the US state department claims has close associations with the outlawed militant group, Lashkar-e-Toiba.
Jamaat denies it has any association with Lashkar, which has been linked to a series of attacks on civilians in Indian-administered Kashmir, as well as attacks on civilians and US troops in eastern Afghanistan.
Jamaat ud-Dawa's publications include praise for violent jihad (holy war), as well as venomous attacks on Hindus, Jews and Western aid agencies.
I asked the UN's humanitarian coordinator, Jan Vandemoortele, why they had worked with such extremist groups.
"No, we never worked with them. We were active in the camps that were run by them," he told the BBC's File on Four programme.
"From a humanitarian perspective we did not take a position that we would leave those people aside. We knew those people needed help. We intervened but we never had any direct relationship with those groups."
The UN says it was a matter of life and death but what's interesting is that Jamaat ud-Dawa and al-Rashid Trust and their brand of extremist Islam never had a big presence in these areas before the earthquake.
But their relief efforts - and the aid they got from international agencies - have really boosted their position locally.
One Jamaat leader told us that people were now trusting them with their children - they hadn't before the earthquake - and they had actively recruited hundreds of children left orphaned or fatherless.
He said they had already sent 400 such children under the age of nine to board at their madrassas, or religious schools, some hundreds of miles from their homes.
That's despite a Pakistan government promise a year ago that these vulnerable children would be looked after either by their extended families or by the state, not by outside agencies.
Madrassas have not had a good press in the West in recent years, with some being linked to the Taleban and the recruitment of other militants.
Whole areas were flattened, such as here in Balakot
But of course, the vast majority of madrassas in Pakistan are not controversial.
And every Jamaat leader I spoke to kept reassuring me that their schools have a broad-based curriculum.
But at one of their schools in the town of Mansehra - set up initially with the help of the United Nations Children's Fund, Unicef - primary children were singing a song at morning assembly which many might find disturbing.
It includes the line: "When people deny our faith, ask them to convert and if they don't, destroy them utterly."
I asked the Jamaat ud-Dawa spokesman, Abdullah Montazzer, why they were teaching such bloodthirsty songs to young children.
"No, they weren't singing that," he said. "Lots of infidels came in the aid effort and they weren't harmed. I don't believe these kids were singing these kind of songs."
I put it to him that virtually everyone I had spoken to in Pakistan said Jamaat and Lashkar were the same thing.
"We are not at all a militant organisation and we have no links with Lashkar at all."
Larry Robinson, who served as political counsellor at the US embassy in Islamabad until a year ago, says it is not so simple.
"The al-Rashid Trust was identified very early on after 9/11 as a major financial supporter of terrorist organisations, including al-Qaeda," he told the BBC.
"It was officially banned and shut down and yet it has continued to operate, and it remains one of the larger charitable organisations in Pakistan.
"More recently the United States has put Jamaat ud-Dawa on the same list although the UN has not yet done so. These are both quite substantial organisations that do a large amount of very legitimate charitable and disaster relief work.
But he says there is no doubt that Jamaat ud-Dawa is also involved in activities that are not purely humanitarian.
"Jamaat ud-Dawa has a relationship to Lashkar-e-Toiba very similar to that of Sinn Fein to the IRA."
Pakistan's government praised both Jamaat ud-Dawa and the al-Rashid Trust in the immediate aftermath of the earthquake.
It said it was not aware of orphans being recruited to madrassas, but that it was monitoring the situation.
Interior Minister Aftab Mohammad Sherpao said the authorities could not take action against Jamaat ud-Dawa because the group had not been banned by the UN Security Council.
However, he said, the government would act if the group strayed beyond its humanitarian mission.
But should groups which espouse ideas of violent jihad be allowed to look after children at all - let alone those traumatised by the earthquake?
Samina Ahmed of the International Crisis Group, a research organisation dedicated to reducing conflict in the world, thinks not.
"It's the concept of violence being put in an acceptable religious form that I think is so incredibly dangerous - as dangerous as the physical training in the use of guns.
"It is accepting the concept of a very distorted version of radical Islam."
Hear the full story on Radio 4: Tue 3 Oct 2000BST, repeated Sun 8 Oct 1700BST
or online at the File on 4 website