A prominent human rights activist in Bahrain has been jailed for five years over tweets alleging prison torture in his country and misconduct in Saudi Arabia’s war in Yemen, despite international criticism of his trial.

Nabeel Rajab’s sentencing marks the latest chapter in a long crackdown on dissent in Bahrain, a tiny island kingdom off the coast of Saudi Arabia that is home to the US Navy’s 5th Fleet.

He is already serving a two-year sentence handed down last July over television interviews he gave that included criticism of Bahrain.

Rajab has been taken to hospital several times during his most recent incarceration after he suffered heart problems and ulcers.

His Twitter account posted a message on Wednesday saying he entered the court with a “cheerful smile” before his sentencing. After his sentencing, he raised his hands, made a peace sign and laughed.

Bahrain’s constitution guarantees its citizens freedom of speech. However, Rajab was prosecuted under laws making it illegal to offend a foreign country, spread rumours during wartime or “insult” a government agency.

The court’s decision drew immediate condemnation from human rights organisations.

Amnesty International said it showed Bahrain’s “utter contempt for freedom of expression”, while the Paris-based International Federation for Human Rights, in a joint statement with Rajab’s Bahrain Center for Human Rights and the World Organisation against Torture, said his imprisonment “illustrates once again the current crackdown on any dissenting voice in Bahrain”.

Western diplomats were on hand for Rajab’s sentencing hearing in Manama, Bahrain’s capital.