1 February 2015
Last updated at 11:57 ET
The militants attacked in the early hours of Sunday, and gunfire was reported on the streets of the city.
Last week's assault by Boko Haram on the city was also stopped by the army.
Boko Haram began guerrilla operations in 2009 to create an Islamic state. It has taken control of many towns and villages in north-eastern Nigeria in the last year.
The conflict has displaced at least 1.5 million people, while more than 2,000 were killed last year.
'Stray bullets' Brig Gen Olukolade was quoted by the AFP news agency as saying that "the terrorists incurred massive casualties" on Sunday.
"The situation is calm as the mopping up operation in the affected area is ongoing," he added.
A number of eyewitnesses confirmed the army claim.
They also said that several civilians had been hit by stray bullets and bombs during the fighting.
The army was supported by vigilantes who recently have taken a central role in fighting the militants.
The military's handling of the six-year insurgency has often been criticised.
Boko Haram at a glance
Who are Boko Haram?
Why Nigeria has not defeated Boko Haram
Boko Haram's last attempt to take over Maiduguri a week ago was stopped by the military.
But the militants did succeed in capturing the town of Monguno - 125km (80 miles) outside the city and took over a military base.
With the insurgents gaining more and more territory Maiduguri - home to tens of thousands of people who have fled their homes because of the conflict - has been increasingly vulnerable.
Aid agencies have warned that the fall of the city would trigger a humanitarian disaster.
Analysts say that the rebels are stepping up their attacks ahead of elections in Nigeria on 14 February.
President Goodluck Jonathan declared a state of emergency in Borno and two neighbouring states in 2013, vowing to defeat the militants.
However, Boko Haram has stepped up attacks since then and there are fears that many people in the north-east will not be able to vote in the election because of the conflict.
The African Union (AU) has this week backed plans for a West African task force of 7,500 troops to fight Boko Haram.
Four of Nigeria's neighbours - Benin, Cameroon, Chad and Niger - have agreed to contribute troops.
Are you in the area? Email haveyoursay@bbc.co.uk with your experiences.
Have your say
by Rashida Adjani and Biodun Iginla, BBC News, N'Djamena, Chad
The
Nigerian army says it has repelled an assault by Boko Haram Islamist
militants on the strategic north-eastern city of Maiduguri.
Defence Ministry spokesman Chris Olukolade is quoted as
saying the attack was "contained" and the rebels suffered heavy
casualties.The militants attacked in the early hours of Sunday, and gunfire was reported on the streets of the city.
Last week's assault by Boko Haram on the city was also stopped by the army.
Boko Haram began guerrilla operations in 2009 to create an Islamic state. It has taken control of many towns and villages in north-eastern Nigeria in the last year.
The conflict has displaced at least 1.5 million people, while more than 2,000 were killed last year.
'Stray bullets' Brig Gen Olukolade was quoted by the AFP news agency as saying that "the terrorists incurred massive casualties" on Sunday.
"The situation is calm as the mopping up operation in the affected area is ongoing," he added.
A number of eyewitnesses confirmed the army claim.
They also said that several civilians had been hit by stray bullets and bombs during the fighting.
The army was supported by vigilantes who recently have taken a central role in fighting the militants.
The military's handling of the six-year insurgency has often been criticised.
Boko Haram at a glance
- Founded in 2002, initially focused on opposing Western-style education - Boko Haram means "Western education is forbidden" in the Hausa language
- Launched military operations in 2009 to create Islamic state
- Thousands killed, mostly in north-eastern Nigeria - has also attacked police and UN headquarters in capital, Abuja
- Has abducted hundreds, including at least 200 schoolgirls
- Controls several north-eastern towns
- Has launched attacks on Cameroon
Who are Boko Haram?
Why Nigeria has not defeated Boko Haram
Boko Haram's last attempt to take over Maiduguri a week ago was stopped by the military.
But the militants did succeed in capturing the town of Monguno - 125km (80 miles) outside the city and took over a military base.
With the insurgents gaining more and more territory Maiduguri - home to tens of thousands of people who have fled their homes because of the conflict - has been increasingly vulnerable.
Aid agencies have warned that the fall of the city would trigger a humanitarian disaster.
Analysts say that the rebels are stepping up their attacks ahead of elections in Nigeria on 14 February.
President Goodluck Jonathan declared a state of emergency in Borno and two neighbouring states in 2013, vowing to defeat the militants.
However, Boko Haram has stepped up attacks since then and there are fears that many people in the north-east will not be able to vote in the election because of the conflict.
The African Union (AU) has this week backed plans for a West African task force of 7,500 troops to fight Boko Haram.
Four of Nigeria's neighbours - Benin, Cameroon, Chad and Niger - have agreed to contribute troops.
Are you in the area? Email haveyoursay@bbc.co.uk with your experiences.
Or use the link below to leave a comment.
Boko Haram
From other news sites
-
ABC Online Boko Haram: Nigeria's military repels fresh militant attack on key city Maiduguri 1 hr ago
-
Yahoo! UK and Ireland Nigerian army repels fresh Boko Haram assault on key city 2 hrs ago
-
Reuters UK Boko Haram insurgents attack northeast Nigeria's capital city 3 hrs ago
-
Channel 4 Boko Haram launch new assault on Nigerian city 7 hrs ago
-
Kenya Broadcasting Corporation Key Nigerian city under fresh attack 10 hrs ago
- About these results