TRIPOLI, April 7 (NNN-AGENCIES) -- Libyan authorities released 28 Eritreans and seven Nigerians who were captured and enslaved by Daesh in Sirte and had been held in detention since the jihadist group lost the city in December.

The group, all but two of whom are women and children, escaped from Sirte, a former Daesh stronghold in central Libya, while forces from the nearby city of Misrata battled to oust the militants late last year.

Some of the women were on their way to Europe when Daesh fighters kidnapped and held them as sex slaves.

After they escaped from Sirte, they were investigated for possible ties to the group and held for several months in a Misrata prison.

In stories published last year, the women recounted how the group forced them to convert to Islam and sold them as sex slaves.

The Libyan attorney-general's office announced that it had cleared the women of any wrongdoing in mid-February, but their release was delayed for several more weeks, with no explanation.

On Wednesday, they were received by staff from the U.N. refugee agency (UNHCR) and the Libyan Red Crescent, before being taken to a shelter for medical checks.

I'm very happy, I can't describe how I feel, but I am very happy, I can start a new life and see my family again, one 14-year-old Eritrean girl said before leaving the prison with the rest of the group on a Red Crescent bus.

A UNHCR official said the entire group had scabies, but otherwise appeared to be in reasonable physical condition.

The agency expects to resettle the Eritreans as refugees.

We will send them to a safe house where they can be treated if they need medical treatment, and receive assistance from us, and be protected, said Samer Haddadin, head of the UNHCR's Libya mission.

At the same time we will be processing them for refugee status determination and we are doing this to make sure we can find a resettlement country for those who meet the resettlement criteria.

The Nigerians, five women and two children, will be able to apply for asylum or be offered repatriation.

Dozens of women and children who escaped from Sirte or were picked up there by Libyan forces are still being held in Misrata. They include Libyans, Tunisians, and nationals from several sub-Saharan African countries. A group of Filipino nurses were freed in February.

Daesh took control of Sirte in early 2015, turning the coastal city into its most important base outside Syria and Iraq and stationing hundreds of foreign fighters there. It took Misrata-led forces almost seven months to recapture the city.