Boko Haram jihadists attacked two military bases in northeast Nigeria's Borno state, near the border with Cameroon, injuring six soldiers, two military sources told AFP on Sunday.
The attacks were the latest against military targets in the region with security becoming a major campaign issue ahead of presidential and legislative elections next month.
President Muhammadu Buhari, who came to power in 2015 on a pledge to end the Islamist insurgency, is seeking re-election in the February 16 polls.
Early on Sunday, troops fought off an attack by fighters believed to be from the Abubakar Shekau faction of Boko Haram in the town of Pulka along the border with Cameroon.
"The terrorists attacked around 1:15 am (0015 GMT) and soldiers engaged them in a 30-minute fight, forcing them to withdraw," a military officer said in an account confirmed by another officer.
The fighters' intention was to attack and loot the town after overrunning the base, said the officer, who asked not to be identified because he was not authorised to speak to the media.
Late on Saturday fighters from the same faction attacked another base in Logomani village near the town of Gamboru, leading to a fight that left six soldiers injured.
"Troops came under attack by Boko Haram terrorists who came in four gun trucks around 6:30 pm (1730 GMT)," the second officer told AFP.
"Six soldiers were wounded from bomb fragments," he said.
Boko Haram has intensified attacks on military targets in the region over several months.
On Wednesday and Thursday the jihadists attacked three bases in Borno and neighbouring Yobe states, stealing weapons and burning the bases.
Boko Haram's jihadist insurgency in northeast Nigeria has claimed 27,000 lives since 2009.
More than two million people have also been forced to flee their homes, triggering a humanitarian crisis in the region.