Somalia's prime minister is predicting that al-Shabab extremists will be defeated militarily by the end of the year, but he said tackling the root causes that attract young people to the al-Qaida linked group will take some time.

Omar Abdirashid Ali Sharmarke told reporters after a closed Security Council meeting on Monday that al-Shabab may increase its attacks this month when the Muslim holy month of Ramadan begins, as it has done in recent years.

But he says the military campaign by Somali and African Union forces has been successful and al-Shabab now controls only 20 percent of the country.

Sharmake says he hopes "that in the coming few months the whole country will be liberated" He adds that "we are really on the verge of defeating them in terms of conventional arms."