Nigeria’s President Goodluck Jonathan has ordered the release of all women held in connection with “terrorist activity”, the defence ministry says.
The decision was aimed at enhancing peace efforts in Nigeria, it added.
The army is conducting an offensive in three states, where an emergency was declared last week to fight the militant Islamist group Boko Haram.
The group had set the release of women and children as a condition for talks with the government.
More than 2,000 people have died in the conflict in Nigeria since Boko Haram launched its insurgency in 2009 to create an Islamic state.
Earlier this month, it said it had abducted women and teenage girls in response to the security forces arresting the relatives of its fighters.
It said it would treat them as “slaves”.
Human rights concerns
The defence ministry said a number of suspects detained for “terrorist activities” would be handed to state governments for “further rehabilitation” before being released.
“The measure, which is in line with presidential magnanimity to enhance peace efforts in the country, will result in freedom for suspects, including all women under custody,” it added, in a statement.
BBC Hausa Editor Mansur Liman says the decision signals that Mr Jonathan has not shut the door to talks with Boko Haram, despite ordering a military offensive against the group.
Boko Haram will have to decide whether it wants to reciprocate by freeing the hostages it is holding and entering into talks to end the insurgency, he adds.
Mr Jonathan declared a state of emergency in three north-eastern states – Borno, Yobe and Adamawa, where Boko Haram has been most active.
Some 2,000 soldiers were deployed to the region last week, in the biggest campaign to date against Boko Haram.
The military says it has also carried out air strikes, destroying the group’s bases.
US Secretary of State John Kerry has urged the Nigerian army to show restraint and not violate human rights as it pursues the militants.
Mr Kerry said there were “credible allegations” of “gross human rights violations” by the Nigerian military.
Last November, Amnesty International accused Nigeria’s security forces of carrying out widespread abuses in their campaign against Boko Haram, including extra-judicial killings, enforced disappearances and torture.