Nigerian officials say at least three bombs exploded in the northeastern city of Maiduguri on Friday, and another in a nearby city.
Witnesses say the blasts took place within a short period of time in Maiduguri, where the government has blamed increasing violence on the radical Islamist sect Boko Haram.
Authorities say one of the explosions was a suicide bombing but the only deaths were the two bombers. They say the men targeted a military compound that is home to a unit charged with protecting the city from Boko Haram, but were not able to get into the base. The bombers detonated their explosives at the gate.
Officials say another explosion took place at an Islamic college where people had gathered for Friday prayers. It was not immediately clear if there were casualties.
Police say a bomb also went off at a police post in the neighboring sate of Yobe.
On Thursday, military officials said troops in Maiduguri had started searching homes for illegal weapons that could be used by the sect.
The sect does not recognize Nigeria's government or constitution and claims it is fighting to create a new country ruled by strict Islamic law.
In July of 2009, Boko Haram launched a brief uprising against the government, prompting a heavy military response that killed about 700 people in one week of fighting.
More recently, the shadowy group has carried out a series of bombing and shootings. In August, it claimed responsibility for a bombing that killed 24 people at the Abuja headquarters of the United Nations.
Boko Haram means “Western education is a sin” in the native Hausa language.