Somali rebel group al-Shabab has announced that it has banned the use of internet through mobile handsets and fibre optic cables throughout Somalia.

In an announcement broadcast on Wednesday by a radio station affiliated with the group and later in a statement released to local media, al-Shabab said telecommunication companies had 15 days to comply with the order.

"Any individual or company that is found not following the order will be considered to be working with the enemy and they will be dealt with in accordance Sharia law." the statement said.

It was not immediately clear if internet providers in Somalia will follow the order. The two main internet providers in Somalia, Hortel Inc and Nationlink Telecom, did not immediately respond to requests for comment.

Al-Shabab has been losing ground to Somalia's internationally recognised government troops and African Union peacekeepers, but the al-Qaeda-linked group still controls significant part of the country.

Mobile internet (3G) was introduced to Somalia a year ago and has proven popular. Fibre optics arrived in Mogadishu in November last year and homes are yet to be connected.

Somalia has one of the lowest internet penetration in world with just over 1 percent of Somalia's estimated 10 million population connected.

Most of those who access the internet in Somalia do so through the many internet cafes that dot the country's big cities and towns. The ban, al-Shabab said, will not affect the cafes.

Follow Hamza Mohamed on Twitter: @Hamza_Africa