Media captionA friend of the Yousafzai family told the BBC's Orla Guerin the letter was a confused damage control attempt by the Taliban after Malala's UN speech

A Pakistani Taliban leader has sent a letter to schoolgirl Malala Yousafzai, 16, expressing shock that she was shot by Taliban gunmen last year.

The Taliban were universally condemned after gunmen shot Malala in the head.

In his letter to Malala, Adnan Rasheed stops short of apologising but says he wished the attack "had never happened".

He also claims the shooting was not in response to Malala's campaign for girls' education, but because she ran an anti-Taliban "smear campaign".

Malala - who is considered a contender for the Nobel Peace Prize - is credited with bringing the education issue to global attention.

Speaking at UN headquarters in New York last Friday, she said that books and pens scared extremists. She also urged education for all, including "for the sons and daughters of the Taliban and all the terrorists".

Analysis

By M Ilyas KhanBBC News, Islamabad

Adnan Rasheed's "advice" to Malala Yousafzai comes just days after she held centre stage at the United Nations last Friday.

Even if he has written the letter in personal capacity, it certainly has the sanction of the TTP - the Pakistani Taliban group that admitted it attempted to assassinate the child activist in 2012.

Mr Rasheed is a former non-commissioned officer of the Pakistan Air Force who was sentenced to death for his role in a 2003 attempt on the life of former military ruler, Pervez Musharraf.

In 2012, the TTP attacked a jail in the north-west of the country, freeing him and hundreds of other prisoners. He has since appeared in some high-profile TTP videos.

The letter is apparently an attempt to attract media attention with a view to counter the impact of Malala's speech at the UN, and to further divide a society where the educated middle class is already in disagreement over whether Ms Yousafzai is a hero or an agent of the West.

'Brotherly' emotions

Writing in his "personal capacity", Rasheed said he felt "brotherly" emotions towards Malala because they belong to the "same Yousufzai tribe".

However, he refuses to condemn the attack, saying the judgement on whether it was correct or not should be left to God.

Rasheed says he first heard of Malala's work when he was in prison, when the BBC Urdu service broadcast a diary that she wrote.

He says he wished he had been able to "advise" her before the attack, which he describes as an "accident".

The Taliban leader also says that his group is not "against education of any men or women or girls". Instead he claims Malala was targeted because she campaigned to "malign [the Taliban's] efforts to establish the Islamic system".

"You have said in your speech that the pen is mightier than the sword, so they attacked you for your sword, not for your books or school," he writes.

Rasheed finishes by telling Malala to "come back home, adopt the Islamic and Pashtun culture and join any female Islamic madrassa [school], use your pen... and reveal the conspiracy of the tiny elite who want to enslave the whole of humanity".

Media playback is unsupported on your device

Media captionGordon Brown: "It's taken her to completely put the Taliban on the defensive"

The letter also contains references to former US Secretary of State Henry Kissinger, British philosopher Bertrand Russell and Indian leader Mahatma Gandhi.

A friend of the Yousafzai family told the BBC the correspondence was a confused and belated attempt at damage control by the Taliban in light of Malala's UN speech, which received a standing ovation.

Meanwhile the girl's parents said in a statement that they were aware of the letter but had not received it directly and had no wish to comment on it.

Former UK Prime Minister Gordon Brown, who serves as the UN's special envoy on global education, said on Wednesday that Malala had clearly had a profound effect on the Taliban.

"It's taken her to put the Taliban completely on the defensive, and that's why they're issuing this statement now," he said.

"But we know that they're still bombing schools, they're still destroying classrooms, they're still murdering teachers, and they're still massacring groups of students."

After the shooting, Malala was flown from Pakistan to the UK for treatment, and now lives in Birmingham, central England.

Her speech on her 16th birthday at UN headquarters in New York was her first public address since last October's attack.

Malala said she was fighting for the rights of women because "they are the ones who suffer the most".

A quarter of young women around the world have not completed primary school.