President Hassan Sheikh Mohamud, who was elected in May after a previous term, said past approaches to Al-Shabaab had not worked, and his government was open to alternatives including talks when appropriate.
"We are not right now in a position to negotiate with Al-Shabaab. We will, at the right time," Mohamud told a think tank during a visit to Turkey this week.
"Even now... we open the door for those who want to denounce the violence, the extremist ideologies, and join the mainstream life in Somalia."
He said the Al-Qaeda affiliate responsible for deadly attacks across East Africa had developed a "coping mechanism" to military aggression and could not be eliminated by force alone.
Mohamud said containing the militants in Somalia and degrading them militarily -- the two key policies of past Somali administrations backed by foreign partners -- had not proved enough on their own.
The former academic and peace activist said that cutting off Al-Shabaab's financial flows, and countering their hateful message, needed to complement a military approach to tackling the extremists.
Shortly after his election, Mohamud welcomed an announcement by US President Joe Biden to redeploy American troops to Somalia, reversing a decision by Donald Trump to withdraw most US forces from the fight against Al-Shabaab.