Two bomb attacks have hit separate locations in northern Nigeria in what officials believe were attempts by Boko Haram terrorist group to make up for its recent losses in the face of the Nigerian army.

A civilian vigilante in Banki, near the Cameroon border in the northeastern state of Borno, said on Tuesday that an attack earlier in the day nearly rattled a camp of people displaced by Boko Haram violence.

Musa Ahmad, who works with the military against Boko Haram, said the attack was carried out by a 10-year-old girl about noon local time, adding that the minor was killed after she detonated her explosives near the camp for internally-displaced people.

"She was asked to stop by soldiers. But she ignored them. They threatened to shoot her if she didn't stop. She obeyed and she was asked to lift up her hijab," said Ahmad, adding, "She did and explosives were found to be strapped on her. Suddenly she pulled on the trigger and exploded."

The vigilante said the death of the girl was the sole casualty of the incident, adding that the attack bore the hallmarks of similar attacks by Boko Haram as the Takfiri group has repeatedly used minors and women to carry out assaults against civilians and security forces.

Ahmad said Boko Haram has been desperately seeking to make up for the losses it has suffered at the hands of the Nigerian army in the recent time.

Earlier on Tuesday, at least two people, including the attacker, were killed in another act of terror, where the assailant targeted people performing morning prayers inside a mosque in Dalori, on the outskirts of Maiduguri, the capital of Borno state.

Residents and authorities said the blast happened at about 5:30 a.m. and the attacker was trying to enter the mosque but a guard stopped him.

"One of the worshippers, who was apparently on guard, grabbed him and the explosives went off, killing both of them. Worshippers were saved," said a resident.

Nigeria has been at war with Boko Haram since the group started an insurgency in Borno state about eight years ago. Almost 15,000 people have been killed while the violence has displaced more than two million.

Boko Haram has pledged allegiance to Daesh, another Takfiri terrorist group, which has been wreaking havoc in the Middle East and North Africa over the past few years, Press TV reported.