A court in Pakistan acquitted eight out of 10 Taliban militants jailed for shooting child rights activist Malala Yousafzai in the head, a senior police official said Friday.

Salim Khan, a senior police official with knowledge of the high-profile but secret trial, said the eight men were freed because there was not enough evidence to prove that they were connected to the shooting, reported the Daily Times.

"During the trial, all the 10 persons had admitted and confessed their role in Malala's attack before the judge of the anti-terrorism court," said Khan, according to Reuters.

In April, the anti-terrorism court, based in the northwestern Khyber Pakhtunkhwa province, found all 10 Pakistani Taliban men guilty and sentenced them to life in prison, reported the BBC. But only two of them, Izhar Khan and Israrullah Khan, were actually convicted.

A source in Pakistani security claimed the eight Taliban militants were freed "quietly, to avoid a media fuss," reported the Daily Mirror.

"The trial had absolutely no credibility as nobody was there to witness it but a public prosecutor, a judge, the army and the accused," a source told the Daily Mirror. "This was a tactic to get the media pressure away from the Malala case because the whole world wanted convictions for the crime."

"Now didn't Malala get a rough deal back home? Eight of the 10 accused in her case have walked—insufficient evidence, of course, Pakistani law style," said a commentary in Pakistan Today, hitting on the country's justice system.

"First poor Malala got Talib justice, then she got a taste of western justice and now she's some Pakistani justice. Wonder which she'd be inclined to advocate more?" said the newspaper.

Seventeen-year-old Yousafzai, who shared last year's Nobel Peace Prize, survived a shooting attack by Taliban militants in the Swat province in 2012. She now lives in Britain with her family and continues to champion rights of girls in Pakistan.