Image caption Malala has given her first in-depth interview since being shot on a bus on her way home from school

A Pakistani teenager shot in the head by the Taliban for championing girls' rights to education has said talks with the militants are needed for peace.

Malala Yousafzai was attacked by a gunman on a school bus near her former home in Pakistan in October 2012.

The targeting of a schoolgirl who had spoken out for girls' rights to education caused outrage in Pakistan and around the world.

The 16-year-old was treated in the UK and now lives in Birmingham.

She spent months in hospital and required several operations to repair her skull.

In her first in-depth interview since the attack, Malala told the BBC that discussions with the Taliban were needed to achieve peace.

"The best way to solve problems and to fight against war is through dialogue," she said.

Media playback is unsupported on your device Media caption Malala Yousafzai: In Pakistan "we know that terrorists are afraid of the power of education"

"That's not an issue for me, that's the job of the government... and that's also the job of America."

In July, plans for talks involving the Taliban, the US and the Afghan government were frustrated by a row over the status of the Taliban's newly opened office in Doha, Qatar.

Malala said it was important that the Taliban discussed their demands.

"They must do what they want through dialogue," she said.

"Killing people, torturing people and flogging people… it's totally against Islam. They are misusing the name of Islam."

Malala also described the day of the attack for the first time. She said the street her school bus was travelling on was unusually deserted before the vehicle was flagged down and the gunman opened fire.

"I could see that there was no-one [there] at that time.

"Usually there used to be so many people and boys and they used to be standing in front of shops. But today... it was vacant."

The teenager, who gave a speech to the UN in July, also spoke of her desire to return to Pakistan and enter politics.

"I will be a politician in my future. I want to change the future of my country and I want to make education compulsory," she said.

"I hope that a day will come [when] the people of Pakistan will be free, they will have their rights, there will be peace and every girl and every boy will be going to school."

Panorama: Shot For Going To School, BBC One, Monday, 7 October at 20:30 BST and then available in the UK on the BBC iPlayer.