'I am Malala' will be published in the autumn and will tell the story of Malala Yousafzai, who was shot by Taliban gunmen

The life story of a 15-year Pakistani girl who was shot by the Taliban will be published later this year, in a deal reported to be worth around £2m.

"I am Malala" will be published in the autumn and will tell the story of Malala Yousafzai, who was shot by Taliban gunmen after she became an advocate for woman's education in the Swat Valley. She now attends a school in Birmingham.

Yousafzai said: "I hope this book will reach people around the world, so they realise how difficult it is for some children to get access to education.

"I want to tell my story, but it will also be the story of 61m children who can't get education. I want it to be part of the campaign to give every boy and girl the right to go to school. It is their basic right."

The book, which will be published by Weidenfeld & Nicholson in the UK and Commonwealth and by Little, Brown in the rest of the world, is the latest stage of Yousafzai's public life which almost ended in tragedy.

Yousafzai began writing a blog on the BBC Urdu service under a pseudonym about life in the Swat Valley in 2009. The Taliban were expanding their influence and at times banned girls from going to school and the Pakistani army fought to re-establish control.

Her real identity became known and she frequently appeared in Pakistani and international media advocating for the right of girls to go to school. In October 2011, Archbishop Desmond Tutu nominated her for the International Children's Peace Prize and in December 2011 she was awarded Pakistan's first National Youth Peace Prize.

In October last year, gunmen boarded a school bus and asked: "Which one of you is Malala? Speak up, otherwise I will shoot you all". When she was identified, a gunman shot her in the head and the bullet passed through her head, neck and embedded itself in her shoulder.

Yousafzai was flown to England where she was treated at Queen Elizabeth Hospital in Brimingham. Last month she had an operation to rebuild her skull and restore her hearing. Earlier this month Yousafzai went back to school.

In the book, Yousafzai writes: "I come from a country that was created at midnight. When I almost died it was just after midday. It was Tuesday, October 9, 2012, not the best of days as it was the middle of school exams, though as a bookish girl I don't mind them as much as my friends do.

"We'd finished for the day and I was squashed between my friends and teachers on the benches of the open-back truck we use as a school bus. There were no windows, just thick plastic sheeting that flapped at the sides and was too yellowed and dusty to see out of, and a postage stamp."

Since the shooting, Yousafzai has been awarded several peace prizes and is the youngest person to be nominated for the Nobel Peace Prize. Ban Ki-Moon, the secretary general of the United Nations, announced that the UN will celebrate Malala Day on 10 November.

A spokeswoman for Weidenfeld and Nicolson could not confirm reports about the value of the publishing deal.

Arzu Tahsin, the deputy publishing director of Weidenfeld & Nicolsonsaid: "This book will be a document to bravery, courage and vision. Malala is so young to have experienced so much and I have no doubt that her story will be an inspiration to readers from all generations who believe in the right to education and the freedom to pursue it."