DAR ES SALAAM (Reuters) - A court in Tanzania sentenced two opposition leaders to five months in prison on Monday for insulting President John Magufuli, a decision likely to fuel criticism that authorities are undermining democracy and stifling free speech.

The court in the southern highlands convicted Joseph Mbilinyi, a lawmaker from the main opposition CHADEMA party, and local leader for the party Emmanuel Masonga for using abusive language against the president at a public rally in December. Court documents seen by Reuters show that Mbilinyi was accused of associating Magufuli with an alleged assassination attempt on vocal opposition MP Tundu Lissu last year. Lissu, a fierce critic of Magufuli’s government, was shot several times by unknown gunmen in the administrative capital Dodoma in September. He sought treatment abroad and has yet to return. Magufuli condemned the attack on the opposition lawmaker and called for a swift investigation. “Mbilinyi ... used insulting language against President John Magufuli ... likely to cause breach of peace,” said part of the charge sheet. According to Tanzania’s penal code, “any person who uses obscene, abusive or insulting language to any other person in such a manner as is likely to cause a breach of the peace” faces a maximum sentence of six months in jail. CHADEMA’s deputy secretary general John Mnyika told reporters on Monday that the opposition party would appeal against both the convictions and sentences.

The United States, European Union and several Western embassies in Tanzania last week voiced concern over politically-related violence and allegations of human rights abuses. “We note with concern recent developments which threaten democratic values and the rights of Tanzanians in a country which is widely respected in the world for its stability, peacefulness and freedoms,” the European Delegation to Tanzania said in a statement on Friday.

But the criticism is unlikely to hurt the government politically, since it remains in an electorally strong position. Three people, including a university student, were killed over the past few weeks in various parts of Tanzania in politically-related incidents, according to opposition leaders. An opposition figure and a journalist have also disappeared. More than 10 people, including university students and a lecturer, have been charged in court over the past two years with insulting the president via social networking platform like WhatsApp.

Insulting the president on social media was made a criminal offence under a cyber crimes law passed in 2015 before Magufuli came into office.