The European Parliament President Martin Schulz presented the award to the 16-year-old at a ceremony in Strasbourg, France.
Malala, who was nominated for the Nobel Peace Prize earlier this year, dedicated the award to "the unsung heroes of Pakistan" and to human rights campaigners worldwide.
"I am hopeful the European Parliament will look beyond Europe to the suffering countries where people are still deprived of their basic rights, their freedom of thought is suppressed, freedom of speech is enchained," she said.
"Many children have no food to eat, no water to drink and children are starving for education. It is alarming that 57 million children are deprived of education... This must shake our conscience," she said.
More From This Section
She said children in countries such as Pakistan "do not want an iPhone, a PlayStation or chocolates, they just want a book and a pen".
Schulz called Malala "a global icon" and told her "you have given hope to millions of children".
The Sakharov Prize for free speech is awarded by the European Parliament annually in memory of Soviet physicist and dissident Andrei Sakharov.
The 50,000-euro (USD 65,000) prize is considered Europe's top human rights award. Malala joins a distinguished list of winners of the prize that includes South Africa's Nelson Mandela and Aung San Suu Kyi of Myanmar.
Malala rose to prominence in 2009 for anonymously writing a blog for BBC Urdu about life under Taliban rule and the lack of education for girls in the mountainous Swat Valley.
A Taliban shot her as she was riding in a bus with school friends. She was flown to the UK for specialised treatment at a hospital in Birmingham. She now lives with her family in Birmingham.