Somalia has restored its internet connection after repairing a severed undersea cable, a telecoms official said on Monday, after an outage that the government said had cost the economy millions of dollars a day.
However, a police officer said attacks by Islamist militants had dropped during the outage that lasted more than three weeks.
"The internet is now back and clients are using it," said Adnan Ali, the media director for Hormuud Telecom, the country's top operator.
Businesses had to close or improvise to remain open during the shutdown and the telecoms minister told state radio it cost the equivalent of about $10mn in daily economic output.
Information Minister Abdirahman Omar Osman apologised to citizens for the outage, which hit all landline and mobile users apart from those with access to private satellite connections, and called for them to have back-up plans.
"We urge internet companies to have a backup so that people do not suffer another outage in the future," he told Reuters.
Somalia's economy is picking up slowly after the army and an African Union peacekeeping force helped drive Islamist group al Shabaab out of Mogadishu and other strongholds.
Al Shabaab wants to topple the Western-backed government and rule the country according to its strict interpretation of Islamic sharia law.
Nur Bile, a police officer, said the number of reported attacks by al Shabaab had dropped during the outage, accusing the group of using the web to publicise its attacks and spread its ideology.
"There were almost no blasts in Mogadishu during the outage. Al Shabaab launches the attacks and the media spreads the news on the internet," Bile said.
He said the police had uncovered three bombs planted in vehicles in the capital Mogadishu on Monday.
The militants were not available immediately to comment.
Residents said the resumption of internet access was welcome news.
"I have the chance to communicate with my lost friends and relatives," said 25-year old Aden Ismail.