Somalia’s government has banned TikTok and Telegram social media platforms and an online betting website citing usage by terrorists to spread propaganda.

The ban announcement comes ahead of a second phase of a military offensive against Al-Shabaab. This Islamist militant organisation has been fighting the central government in Mogadishu for more than 15 years in a violent war.

The Ministry of Communications and Technology warned internet service providers in a statement that failing to comply with the restriction by August 24 could result in unspecified legal action.

"In a bid to accelerate the war and elimination of the terrorists who have shed the blood of the Somali people, the minister of communication and technology instructs companies that provide internet services to suspend TikTok, Telegram and 1XBET betting applications, which terrorists and groups responsible for spreading immorality use to spread graphic clips, photos and mislead society."

Since August of last year, the army has been conducting an attack against the Al-Qaeda-affiliated Al-Shabaab in central Somalia, collaborating with local clan militias in a mission supported by African Union forces and US airstrikes.

Despite being expelled from Mogadishu's city in 2011, Al-Shabaab fighters still hold swaths of the countryside and carry out deadly attacks on civilian, political, and military targets.

The troubled Horn of Africa nation's president, Hassan Sheikh Mohamud, has vowed to drive out jihadists, and he is soon to declare a second phase of the offensive against them in southern Somalia.