A poet has been sentenced to three years in prison in Somaliland as part of a wide-ranging crackdown against activists and writers.

Naima Abwaan Qorane, 27, was jailed on Sunday for “anti-national activity of a citizen and bringing the nation or state in contempt”.

Prosecutors said she had expressed opinions on social media that undermined the semi-autonomous state’s claim to full independence.

In a second case on Monday, the same court sentenced Mohamed Kayse Mohamoud, a 31-year-old author, to 18 months in prison on charges of “offending the honour of the president.”

The case against Mohamoud was based on a Facebook post saying the “president is a local”, according to the charge sheet seen by activists.

It was offensive to the president because the president was “a national president” and not a local official, the presiding judge said.

Somaliland, a former British protectorate, declared unilateral independence from Somalia in 1991 as the regime of Mohamed Siad Barre collapsed, but has not been recognised as a fully autonomous state by the international community.

It is effectively self-governing with its own elections, constitution, courts and currency. President Muse Bihi Abdi was elected last year.

Since December there has been a series of arrests and detentions of activists, bloggers and writers. Local human rights workers say at least 12 journalists have been detained, some for up to three weeks.

“The detention of my client was illegal, the charges made against her are politically motivated and the sentence is unfair,” Qorane’s lawyer, Mubarik Abdi Ismail, said. “The the judge was not independent and therefore he could not deliver a free trial.”

He said the poet had been threatened during her interrogation. “On one night while Naima Qorane was in [police] detention in Hargeisa, two hooded men entered her cell and threatened that they will rape her if she would not provide passwords of her mobile phone and her social media pages particularly her Facebook. They took all passwords,” he said.

“In March, two [police] and intelligence officers came to Qorane’s cell and demanded her to tell everything and confess her crimes ... they threatened that they will bring very strong men who would rape her, and then that they would kill her and dump her body into unknown place. They returned the second night and put a loaded pistol of her forehead and threatened that was her last minute in life.”

Qorane was also denied visits from her family for a number of weeks after her father spoke to the media and, though held for political offences, she was not separated from other detainees. She is now being held in Gabiley women’s prison.

Ahmed Hussein Qorane, Naima’s father, said he was given only limited access to visit his daughter and was not surprised by the sentence. “My daughter is innocent ... She has nothing to do with what they alleged. She must be released without condition. They did not allow her to see a doctor. She has bad toothache. They beat her in the detention and her left knee is swollen while she has an injury on her thumb,” he said.

Much of Qorane’s poetry evokes the lost unity of Somalia, but does not explicitly mention Somaliland or its future, supporters say. She read her works at a TEDx conference in the Somali capital, Mogadishu, last year.

Guleid Ahmed Jama, the chair of the Human Rights Centre-Hargeisa Somaliland, said the imprisonment of Qorane and Mahamoud were contrary to the constitution.

“This shows that the judiciary is being used to suppress critical voices. We are very concerned about the judiciary’s acts that are putting people behind bars for expressing their opinion. Somaliland is a democracy. We have a very good constitution. The government needs to respect that constitution,” he said.

Qorane said in 2016 that she had received death threats and been warned to leave Somaliland. “If it happens – though I am not expecting it – jail was built for people not for animals … I will be released one day and the prison experience is not going to change my views,” she said in a local media interview.

There has been no official statement from the Somaliland authorities.

The US mission in Somalia condemned the detention of Qorane and Mohamoud, and called on officials to safeguard freedom of expression.

Said Abdi Hassan, an activist in Somaliland, said Qorane’s sentence was unfair. “She was detained because of her views which everybody has the right to express without fear,” he said. “How can a country claim to be seeking recognition while they disregard rights of the people.

“But we want to tell Naima that even if she is jailed forever, her views will be active. She is a role model for many of our youth by calling for unity and against tribalism.”

Officials contacted in Somaliland said they were unable to comment on the case.

Additional reporting by Abdalle Ahmed Mumin