Many residents of Maiduguri, a northern city of Nigeria, started to flee as Boko Haram attacked on Wednesday, according to military sources.
The attack began in a cashew plantation just a few kilometres far from the Giwa barracks of Maiduguri in Borno.
The shooting was heard around 6:45pm (17:45 GMT), according to local resident Kabir Olaoye.
"I'm trapped near the University of Maiduguri now," he added.
Boko Haram militants who aim to establish a state in northeastern Nigeria have not attacked Maiduguri since their two seizure efforts in January and February.
At the beginning of this year, Boko Haram militants were driven out in some key points of Borno by Chadian and Nigerian forces .
Multinational Joint Task Force (MNJTF), comprising Chad, Niger, Cameroon troops has taken back dozens of towns from Boko Haram for two months. More than 10,000 people were killed in last year’s revolt as millions of residents have been evacuated from their homes.