ISLAMABAD, Pakistan — A Pakistani court on Thursday sentenced 10 men to life in prison for their role in the 2012 shooting of Malala Yousafzai, the teenage Nobel laureate who defied the Taliban with her calls for girls’ education and won worldwide acclaim for her courage.

The sentences were handed down by an antiterrorism court in Swat, the picturesque northern valley that was once a stronghold of the Taliban until a military offensive in 2009 broke their hold.

Ms. Yousafzai, who is now 17, was shot in the head in October 2012 when she was returning home from school with her classmates on a bus. After a brief stay in a military hospital in Rawalpindi, she was airlifted for treatment to Britain, where she is now studying and living with her exiled family.

In September 2014, the Pakistani military announced the arrest of 10 men it accused of being involved in the attack. Officials said the gunmen took orders from Maulana Fazlullah, the leader of the main Pakistani Taliban branch who is believed to be hiding in Afghanistan, when they attacked Ms. Yousafzai and the other students.