A Nigerian court has convicted 45 Boko Haram members in the largest ever mass trial involving the Islamist extremist group.

The closed-door proceedings began early this week at a military barracks in northern Nigeria but have raised the concerns of human rights groups about whether the hearings of 1,669 suspects will be fair.

The judges are drafted from civil courts, while the barracks are being used for security reasons.

The 45 people were sentenced to between three and 31 years in prison, the country’s information minister said in a statement on Friday. Another 468 suspects were released, but the court ordered that they undergo de-radicalisation programs. The government has not said what exactly the hundreds of suspects are charged with.

More than 2,000 detainees are being held at a military base in Kainji, in the central state of Niger, and the Giwa barracks in Maiduguri, capital of the northeastern state of Borno.

Nigeria is trying to show it is making progress against the extremist group that has killed more than 20,000 people during its eight-year insurgency. Boko Haram has yet to comment publicly on the mass trials.

Nigeria has arrested thousands of suspected Boko Haram members in recent years, and military detention facilities are overcrowded. Human rights groups say most of those detained, including women and children, have been picked up at random and without reasonable suspicion. Former detainees have described malnutrition, mistreatment and deaths in the facilities.

Boko Haram’s attacks have spilled into neighboring countries and displaced more than 2.4 million people in the Lake Chad region, creating a vast humanitarian crisis. Some fighters have allied with the Islamic State group. The group provoked international outrage by kidnapping more than 200 schoolgirls, known as the Chibok girls, in April 2014.

In northern Cameroon, nearly 60 men who said they were captured by Boko Haram and forced to fight for them in Nigeria surrendered to authorities.

After spending two years with Boko Haram, the men decided to flee with their families and hand themselves in, according to several men who had surrendered and spoke to journalists at a ceremony in the town of Mozogo on Friday.

A total of nearly 400 people originally from Cameroon – 58 men, 86 women and 244 children – said they had been taken hostage by Boko Haram fighters during attacks on their villages and taken to Nigeria, where they were forced to join the jihadist group.

The men told reporters they had fought for Boko Haram and were laying down their arms of their own will. They surrendered at the border with Nigeria to a village vigilante group formed to combat the jihadists. The vigilantes then handed them over to the authorities.

Ousmane Kouila, the head of the vigilante group, said they had been out on patrol in the border area when they met the fleeing Boko Haram fighters. “They said they were returning and that they were surrendering,” he said.

The local governor went to meet them and ordered them to be moved away from the border to avoid any reprisals by Boko Haram.

“We are counting on them to also convince others who are hesitating (to surrender) and there are a lot of them, they tell us,” said Midjiyawa Bakari, the governor of the Far North region.

Authorities would provide the escapees with psychological help, he said.

“They have been through brainwashing, perhaps also having taken an oath on the Qur’an or made a blood pact,” the governor said, adding they needed help with “all they must have endured” at the hands of Boko Haram.

While Nigeria’s military has arrested many top Boko Haram fighters and last year declared the extremist group had been “crushed”, its leader Abubakar Shekau remains elusive. The group in recent months has carried out a growing number of deadly suicide bombings and other attacks, many carried out by women or children.