The attack began at around 5 am at the camp near the village of Nara, which is about 50 kilometres from the border with Mauritania, said army spokesman Col Souleymane Maiga.
"The army repelled the attackers who had entrenched themselves in the village," Maiga said. "Until around 9 am there were exchanges of fire between the army and the assailants in the streets of the village."
Civilians took shelter as soon as they heard the fighting, said Nara resident Foussein Keita.
Casualty information was not immediately available and the assailants were unknown, Maiga said.
More From This Section
But a source in Mali's intelligence service, who spoke on condition of anonymity because he was not authorised to speak to the media, said the gunmen were Islamic militants linked to Ansar Dine, one of the groups that took control of northern Mali following a military coup in 2012.
A French-led military intervention launched in 2013 scattered the Islamic extremists, though northern Mali remains insecure and in recent months violence has extended further south. In March a masked gunman opened fire in a restaurant popular with foreigners in Mali's capital, Bamako, killing five people.