Suicide bombers killed at least 18 people in three dawn attacks in the northeastern Nigerian town of Damaturu, officials and witnesses said.
Separately, Boko Haram attacked a rural military camp in northeastern Yobe state overnight but were repulsed by troops who killed at least 100 of their fighters, the military said.
Seven troops died in the fighting and nine were injured in the village of Goniri, said army spokesman Colonel Sani Usman.
Hours later, at around 6am local time on Wednesday, when mosques were filled with worshippers performing early-morning prayers, two women suicide bombers struck in Damaturu, Yobe state's commercial centre.
"One of the suicide bombers gained entry into the mosque and detonated explosives, and the other bomber was sighted roaming around the compound and [when] asked questions, she too detonated explosives," said resident Ibrahim Musa.
He said he counted 15 bodies and 12 wounded people rushed to the hospital in Damaturu, which has suffered dozens of attacks during Nigeria's 6-year-old Islamic uprising.
Police Assistant Superintendent Toyin Gbagedesin said seven people died in the Damaturu attacks. There was no immediate way to reconcile the conflicting tolls.
Gbagedesin also reported a third attack by two male suicide bombers on a settlement of Fulani herders that he said killed 10 people.
Residents blamed Boko Haram for the dawn attack on the Muhammadu Buhari Housing Estate.
Nobody claimed responsibility for the attacks, but Nigeria has stepped up efforts to end the six-year conflict with Boko Haram, during which the group has killed thousands in shootings and bombings.
Attacks have spilled over into neighbouring countries. Chadian authorities said a Boko Haram attack on Tuesday near Chad's border with Nigeria left 11 soldiers and 37 militants dead.
Amnesty International estimates 20,000 people have died in this conflict.