Boko Haram was formed in Maiduguri to campaign against Western education
Thousands of Nigerians are fleeing the north-eastern city of Maiduguri following a spate of recent attacks, which have killed at least 40 people.
Some of those leaving are students after the university was closed.
The attacks have been carried out by the radical Islamist group, Boko Haram, which opposes Western education and fights for Islamic rule.
The security forces have been accused of firing indiscriminately and killing civilians after the raids.
Boko Haram has carried out most of its attacks in Maiduguri but has also bombed targets in the capital, Abuja, in recent months.
The BBC's Bilkisu Babangida in Maiduguri says the city is gripped by fear with many people staying indoors.
Correspondents say bus stops are overcrowded as the exodus from the city grows.
Some people are leaving on foot with their belongings and livestock.
On Tuesday morning, a military patrol was targeted in Maiduguri and in the ensuing confusion, four people were shot dead and two soldiers wounded.
There has also been a blast at a church in the town of Suleja, near Abuja.
No casualties have been reported.'Soldiers are not animals'
Our reporter says the university was closed following rumours that the group planned to attack the campus.
University authorities said they had closed the campus because of the growing insecurity in Maiduguri, the capital of Borno state.
Students were due to write end of term exams this week, but the authorities urged students to stay at home under the protection of their parents.
A student, Leke Oshubu, told the BBC the campus was tense.
"You can't read, you can't do anything in this kind of situation," he told the BBC's Focus on Africa programme.
Several residents told the BBC that following Tuesday's explosion, soldiers fired indiscriminately.
"They just came, shouting 'Hands up' and then started shooting. They think people like us - civilians - are hiding militants," a resident, who asked not be identified, said.
Legislators from Borno state held a press conference on Tuesday in Abuja to condemn the military strategy and to call for an amicable solution to the conflict with Boko Haram, correspondents say.
The head of the military task force in Maiduguri, Brigadier General Jack Okechukwu Nwaogbo, defended his men.
"Soldiers are not animals who will be killing people indiscriminately. Anybody shot or killed by soldiers must have attacked them or is armed, which means he is part of the group we are out to tackle," he is quoted by the AFP news agency as saying.'Motorbikes banned'
On Saturday, residents told the BBC that soldiers had dragged men out of their homes before setting their properties on fire following a Boko Haram attack.
Residents have also been ordered to walk with their hands raised as they approach military checkpoints in the city, correspondents say.
Last week, Maiduguri banned all motorbikes to prevent drive-by shootings by Boko Haram.
Its gunmen often use motorbikes to assassinate security officers and politicians.
The group's official name is Jama'atu Ahlis Sunna Lidda'awati wal-Jihad, which in Arabic means "People Committed to the Propagation of the Prophet's Teachings and Jihad".
But residents of Maiduguri, where it was formed in 2002, dubbed it Boko Haram.
Loosely translated from the local Hausa language, this means Western education is forbidden.
Residents gave it the name because of its strong opposition to Western education, which it sees as corrupting Muslims.