Pakistani police say a court has freed eight out of 10 people charged with organising the shooting of Malala Yousafzai, the schoolgirl activist.

Salim Khan, a senior police official, said on Friday that the eight men were freed because there was not enough evidence to connect them to the 2012 attack in Swat, northwest of the capital Islamabad.

Police had said in April that all 10 had been convicted and jailed for 25 years each in a trial held behind closed doors.

"The only reason for their release was lack of proof against them," Khan said.

Naeem Khan, the prosecutor, said the men had confessed to attacking Malala.

"During the trial, all the 10 persons had admitted and confessed their role in Malala's attack before the judge of anti-terrorism court. But only two of them, Izhar Khan and Israrullah Khan, were convicted while the remaining eight were freed on April 30, 2015," he said.

The case will raise further questions over accountability and secret trials in Pakistan's justice system.

Trials are often held behind closed doors because judges, lawyers and witnesses fear retribution from fighters.

Strong evidence

Al Jazeera's Kamal Hyder, reporting from Karachi, said the court had found strong evidence against two of those charged, but not enough to hold the other eight.

He said the investigation into the 2012 attack in Swat Valley was ongoing.

Inside Story: Who in Pakistan should have protected Malala?

"One of the key suspect who was involved in the attack, Ataullah, escaped to Afghanistan in 2013, he was then arrested by the Pakistani authorities in 2015, and there was strong evidence against him," he said.

"This is a high-profile case and the government will want those guilty of the attacks to be brought to book."

Malala rose to fame during that time when she wrote a diary for BBC's Urdu service using a pen name and later appeared on TV talk shows, championing girls' education in Swat and for peace.

Pakistani Taliban claimed responsibility for the attack on Malala as she travelled home from school in her home. Two other schoolgirls were wounded.

Soon afterwards, Malala was taken to Britain for treatment and never returned to Pakistan after recovery. She has resumed her studies in the UK.

The Swat Valley was under the de facto control of Pakistani Taliban commander Fazlullah from 2007 to 2009, where it imposed a strict brand of Islamic law and carried out public floggings and hangings.

Source: Al Jazeera and agencies