Somalia's President Hassan Sheikh Mohamud has said talks with Al Shabab are his preferred endgame for peace in the country but without negotiations the militia could be defeated militarily.
The Mogadishu government has set a one-year target for expelling the Al Qaeda-linked Al Shabab militant group from the country.
"I believe we will defeat Al Shabab militarily," Mr Mohamud said at a Royal United Services Institute meeting in London on Tuesday.
"We don't have any indication that Al Shabab want dialogue with the Somali government [but] if that happened tomorrow it's our preferred option.
"At the end it may end up with dialogue, rather than killing and maiming and chasing away."
Remaining African Union peacekeepers are poised to leave next December, with the Somali National Army set to start taking over checkpoints from international forces, including at Villa Somalia, the presidential palace, from next month.
Al Shabab has been waging an insurgency against the Somali government since 2006 in a bid to establish its own rule based on a strict interpretation of Sharia.
Mr Mohamud, in his second term as President, said in August he wanted to eliminate the insurgents by early next year.
"The end game is December 2024 when all the Atmis [African Union peacekeeping] forces have to leave the country," he told Rusi.
The focus was on stamping out "the residual" Al Shabab, he said.
That task had been made more difficult by recent fatal flooding in Somalia, he said, although the floods have also made it harder for the militants to spread landmines.
Mr Mohamud's recent drive against Al Shabab began in August last year, with the military rallying behind clan-based militias in central Somalia.
That rare collaboration helped produce the most significant territorial gains over the militants since the mid-2010s but Al Shabab has continued to stage fatal attacks on military and civilian targets.
The latest phase is set to push into southern Somalia, the traditional stronghold of Al Shabab, where Mr Mohamud described progress as "encouraging".
He said there was an acute need for the international community to help Somalia with its military efforts and to build up its state institutions, provide basic services such as health and education, and reconstruct its infrastructure.
The country has also over the years experienced bouts of drought and floods that have led to thousands being displaced.
Mr Mohamud said flooding and other natural disasters related to climate change are holding up the offensive in parts of the country.