LAGOS, Nigeria, May 21 - Nigeria said on Tuesday it would free a number of detained Islamists, including all female ones, in what a senior security source called a move to build popular support for its offensive against Boko Haram militants entrenched in the north.

Nigeria, Africa's most populous state and biggest oil producer, is waging its fiercest military campaign yet against Boko Haram, with warplanes pounding rebel camps and raids netting scores of suspected militants.

"The (prisoner release) 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," a statement by defence spokesman Brigadier-General Chris Olukolade said.

The security source said no sufficient evidence had been found against the male suspects being released. Hundreds of suspects are believed to be held by Nigerian authorities. Olukolade's statement said President Goodluck Jonathan had ordered the prisoner releases on the recommendation of a panel he set up to seek a political solution to the conflict.

The security source said the gesture aimed to win over a population in the remote northeastern region wavering between fear of Boko Haram and resentment of the army's tough tactics.

"We've shown them the stick. Now President Jonathan wants them to see the carrot," he told Reuters.

Jonathan offered an amnesty on Sunday to insurgents who surrender, a sign he is keen to keep channels for a peaceful way out of the conflict open as far as possible.

In his latest video this month, Boko Haram leader Abubakar Shekau accused security forces of detaining the wives and children of its members. He then released footage of other women and children the sect said it had kidnapped in retaliation.

Jonathan declared a state of emergency in the northeastern states of Borno, Yobe and Adamawa last week before unleashing his forces on the well-armed and dug-in Boko Haram militants.

Nigeria asked neighbouring Niger on Monday for support in its week-old offensive against Boko Haram, underlining moves towards West African cooperation against jihadi militants seen as an increasing cross-border threat.

(Reporting by Tim Cocks and Camillus Eboh; Editing by Mark Heinrich)