Nairobi - The United Nations called on Somalia on Sunday to do more to protect the freedom of the press and expression in a country where 30 journalists have been killed in four years.
But in a report the UN noted progress on the issue over the last five years.
The report, drawn up by the UN Assistance Mission in Somalia (UNSOM) as well as the UN Human Rights Council, noted that adoption in January this year of a new federal media law, which "guarantees a number of freedoms, including the right to inform."
But the report also expressed "concern about the law's unclear terminology, which allows for subjective interpretation and undue restrictions to freedom of expression".
"Despite the vibrant media culture in Somalia - which hosts more than 90 media outlets and scores of websites and blogs - numerous violations aimed at journalists and political leaders" are documented in the report.
These include killings, attacks, arbitrary arrests and detention, intimidation, harassment, closure of media outlets, confiscation of equipment and blocking of websites.
"The dangers facing media workers and public figures are illustrated by the fact that, between August 2012 and June 2016, a total of 30 journalists and 18 parliamentarians were killed in Somalia," it added.
While the greatest threat to journalists comes from the Al-Qaeda aligned Shabaab jihadist group, which has vowed to bring down the Somali government, the country's security forces are guilty of numerous violations against journalists and politicians.
"Political activists and journalists are detained in the NISA detention centre, together with Al Shabaab suspects, with no judicial oversight," lamented the report, referring to the National Intelligence and Security Agency (NISA).
"In a worrying development, since February 2016, the NISA has started using the media to show Al Shabaab suspects confessing their crimes," it added.
Somalia is preparing to hold indirect elections in late September and October, in a process which will see 14,000 delegates chosen on a clan basis vote for deputies and representatives in a new upper chamber of parliament.
Those elected will then designate a new president at the end of October. Elections by universal direct suffrage are scheduled in 2020.
This year will be crucial for Somalia's political transition, said the UN report.
"Attacks against individual journalists and media organisations have a deeply corrosive impact on democracy, with profoundly negative repercussions on freedom of expression and human rights in general," said UN High Commissioner for Human Rights Zeid Ra'ad Al Hussein of Jordan.
He called on Somali authorities to investigate violations of freedom of expression "irrespective of the identity of the perpetrators."