When Chadian troops occupied parts of northern Nigeria in the 1980s, Nigerian Major-General Muhammadu Buhari chased them back across the border in a show of strength months before he seized power in a military coup.
Thirty years later, the 72-year-old former strongman has returned as head of state, defeating incumbent Goodluck Jonathan at the ballot box this week, and once again seems determined to end Chad's presence on Nigerian soil.
Chad's battle-hardened troops have been a driving force behind a regional offensive against Boko Haram that has expelled the Islamist group from the major towns of northeast Nigeria in a matter of weeks.
Buhari, himself a Muslim from the north, branded President Goodluck Jonathan's reliance on Chad to suppress the insurgency before the election as a national disgrace. He has promised to restore the territorial integrity of Africa's most populous nation.
In his first speech since winning office, Buhari said he would spare no effort to defeat Boko Haram, which has killed thousands of people in its six-year-old campaign to carve out an Islamist caliphate in Nigeria.
His determination for Nigeria to wrest back the initiative may signal a check to a planned 10,000-strong regional force mandated by the African Union in January, meant to be headquartered in the Chadian capital N'Djamena.
With Buhari vowing to root out corruption and restore prestige to Nigeria's once-proud military, cooperation with neighbouring countries may return to the previous pattern of joint border patrols, rather than a multinational mission on Nigerian soil, analysts said.
"It's a national humiliation for Nigeria to see Chad doing the job of the Nigerian military and Buhari cannot accept that," said Marc-Antoine Perouse de Montclos, fellow at London-based think-tank Chatham House.
"That doesn't mean he'll stop international cooperation... but he'll try to leave the job of fighting Boko Haram with the Nigerian army."
In the long wait for Buhari's inauguration on May 29, the regional operation appears likely to continue. On Tuesday, Chad and Niger forces captured the border town of Malam Fatori, one of Boko Haram's last footholds - just as Buhari's election victory was confirmed.
Despite his nationalist rhetoric, Nigeria's new president-elect was welcomed by West African capitals weary of Jonathan's long neglect of the Islamist uprising in an impoverished and sparsely populated corner of his country.
Senior army officers from Chad and Niger have denounced what they saw as a failure to cooperate by Nigeria, which launched its own separate offensive against Boko Haram. Without Nigerian troops alongside them to occupy liberated towns, Chadian troops have been obliged to retake some communities several times.
"It is impossible for Buhari not to do better than the previous government," Mohamed Bazoum, minister of state for the presidency in Niger, told Reuters. "He will be a good partner for us and I'm convinced that Nigeria will play an important role in eradicating Boko Haram."
CHAD'S DEBY WANTS MULTINATIONAL FORCE
Chad's President Idriss Deby, in an interview last week, called for the African Union force to be deployed quickly and said that the campaign against Boko Haram would take months to complete. He said the group could have as many as 20,000 fighters - far more than usually estimated.
Its revenues sapped by a slump in oil prices, Chad has led African calls for the United Nations to set up a trust fund to fight Boko Haram.
Deby, singled out as the 'Chadian Satan' by Boko Haram leader Abubakar Shekau, expressed his country's continued willingness "to contribute to the stability of the subregion" in a letter of congratulations to Bujari on Wednesday.
Leaders from west and central Africa will discuss the fight against Boko Haram at a summit on April 8 in Equatorial Guinea, but Buhari is not expected to attend, a Western diplomat said.
With an easing of Boko Haram's stranglehold over trade routes to Chad - a main motivation for Deby's intervention - the urgency for its military intervention has eased.
The regional offensive appears to have hurt Boko Haram's operational capacity. Despite pledges by Shekau to disrupt elections in the north, it carried out only minor attacks.
Yet since the killing of its founder Mohammed Yusuf in 2009 in police custody, Boko Haram has proved its ability to go to ground and regenerate.
Buhari's plan to combat corruption in Nigeria's armed forces, improve the pay and equipment of soldiers, and impose a clear chain of command from political leaders in Abuja, will take time, the Western diplomat said.
Any return to violence by disgruntled former militants in the oil-rich Niger Delta, the cradle of Jonathan's support, would distract attention from fighting Boko Haram. With oil prices depressed, Buhari's government may have less scope than its predecessor to buy peace in the Delta, analysts say.
But Buhari's commitment on defeating the Islamists - coupled with his reputation for toughness and northern credentials - could play an important role in winning the collaboration of the northern population, estranged from Abuja by years of indifference and army abuses.
"Buhari has been in the military. He knows the ins-and-outs of the military and I believe he's going to do better than Jonathan," said Aminu Issa, a civil servant in the northern town of Kaduna, a flashpoint of religious tensions. "There will no longer be any Boko Haram."
An increase in support from people in the battleground state of Borno - which voted massively for Buhari - could prove his most effective weapon in the war against Boko Haram.