A Pakistani court on Thursday sentenced 10 militants to life in prison for their involvement in the 2012 attack on teenage activist Malala Yousafzai, a public prosecutor said.

Sayed Naeem said the court announced the ruling at an undisclosed location because of security concerns.

"Each militant got 25 years in jail. It is life in prison for the 10 militants who were tried by an anti-terrorist court," he said. In Pakistan 25 years is considered a life sentence.

Malala was shot in the head by the Pakistani Taliban when she was returning from school. The militants targeted her because she advocated education for women. Malala was initially treated in Pakistan, but was later flown to a hospital in Britain, where she now lives with her family.

Malala, now 17, won world acclaim for her campaign and last year was awarded the Nobel Peace Prize.

Mullah Fazlullah, the Taliban leader who ordered the attack, is still at large, as are other militants who took part in it. The 10 who were sentenced on Thursday were detained by the military last year.

Last summer Pakistan launched a major offensive in the North Waziristan tribal region, a longtime haven for the Taliban and other militant groups.