"In view of the recent development within Maiduguri metropolis a 24-hour curfew is hereby imposed in the city," army spokesman Colonel Tanko Gusau said in the statement.
"This is done to protect lives and properties of innocent and law-abiding people of Maiduguri," capital of Borno state.
Boko Haram fighters launched an attack on the city on Wednesday but were repelled by Nigerian troops after intense clashes, residents and the army have said.
Dozens of militants armed with heavy guns and rocket-propelled grenades stormed the northern outskirts of the city near Giwa military base, shooting and firing explosives indiscriminately, local witnesses told AFP.
The army said in a statement its soldiers had fought off "a band of terrorists" and that two bombs carried by female suicide bombers were detonated ahead of the attack.
There was no immediate information on any casualties.
Sources said the assailants had made attempts to overrun a military facility, the 21 armoured brigade, which was attacked last March 14.
The army said that the situation was now under control
A member of the civilian vigilantes assisting the Nigerian military in the fight against Boko Haram said the attack could have been a reprisal for the losses incurred by the extremists in a Tuesday offensive on their camp some 40 kilometres (25 miles) outside the city.
"The attack was from all indication in response to the huge casualties Boko Haram suffered yesterday in the military operation on their camp in Mafa area in which some women and children were rescued," said the vigilante who asked not to be named.
Get the latest election news, live updates and election schedule for Lok Sabha Elections 2019 on ndtv.com/elections. Like us on Facebook or follow us on Twitter and Instagram for updates from each of the 543 parliamentary seats for the 2019 Indian general elections. Election results will be out on May 23.