President Goodluck Jonathan has declared a state of emergency in parts of the country following attacks from the Islamist sect Boko Haram.
The measure is in force in areas of the Yobe and Borno states in the north-east, Plateau state in central Nigeria and Niger state in the east.
International borders in the affected areas have been temporarily closed.
Jonathan vowed to “crush” Boko Haram, which killed dozens in attacks across the country on Christmas Day.
Announcing the state of emergency in a live televised address, the president said: “The temporary closure of our borders in the affected areas is only an interim measure designed to address the current security challenges.”
He added that his chief of defence staff had been instructed to take other “appropriate” measures, including setting up a special counter-terrorism force.
His remarks follow urgent meetings held with security services.
Earlier on Saturday, speaking at St Theresa's Church Madalla? where 37 people died, the president said Boko Haram had “started as a harmless group” but had “now grown cancerous”.
President Goodluck Jonathan offered his condolences to relatives of those killed on Christmas Day.
While offering his condolences to victims' relatives the president said: “We will crush the terrorists. If there are institutions… which are harbouring terrorists, we will deal with them.”
Earlier this week, the Christian Association of Nigeria (CAN) warned that the community might have to defend itself if the security forces could not protect it.
Also, the leaders of Chad and Cameroon, which are close to Maiduguri, are reported to have held talks about how they can help prevent the violence spreading across their borders.