Navi Pillay calls "deeply disturbing" the conviction of a journalist and the alleged rape victim he interviewed.
The journalist, Abdiaziz Abdinur Ibrahim, and the victim, an unidentified 27-year-old woman, were both sentenced on Tuesday to one year in prison. They were charged with making false accusations and "insulting a government body."
"This is a terrible blow to freedom of expression in a country where independent journalists have also been regularly targeted and killed," Navi Pillay, the UN high commissioner for human rights, said in a statement on Wednesday.
"I am very concerned about the impact the penalization of the woman alleging rape could have in the fight against impunity in sexual violence cases, especially given the reports of increasing sexual violence in Somalia."
Human rights groups have described the trial as politically motivated, accusing the court of covering up rampant sexual abuse of women by the Somali security forces.
"They fabricated a story to hurt the government," the judge, Ahmed Aden, said in court.
'Attack on press freedom'
Ibrahim's arrest followed increasing media attention on reported sexual abuse by Somalia security forces. Earlier in January, Universal TV - a local television station - and Al Jazeera separately published stories about allegations of rape in the city's crowded camps for displaced people.
Ibrahim had not been involved with either story, does not work for either organisation, and had not published anything of his own investigation before he was detained. The National Union of Somali Journalists called the trial an attack on press freedom.
The United States also criticised the trial, with the State Department saying it "sent the wrong message to perpetrators of sexual and gender-based violence."
During the trial, the judge refused to hear the testimony of three witnesses who planned to appear in defence of Abdinur and the woman.
Hassan Sheikh Mohamud, the president of Somalia, told Al Jazeera on Sunday that while his government "is the only government that has proven" it is dedicated to improving the lives of women in Somalia, he will not directly interfere in the ongoing court case.
"I don't have the right to interfere in the judicary system... my interference into the judiciary system, will never help the rule of law in Somalia," Mohamud said in an interview.
Paris-based Reporters Without Borders ranks Somalia 175th out of 179 countries surveyed for its 2012/2013 World Press Freedom index.