A Ugandan author accused of insulting the president and his family has been released after being re-arrested moments after a court freed him on bail.

Kakwenza Rukirabashaija was “dumped” by the military at the gate of his home in eastern Uganda on Wednesday, his lawyer said.

The novelist’s wife also confirmed the release.

The lawyer said the author was unwell and had been taken to hospital for treatment.

The award-winning writer was charged with offensive communication after he was accused of insulting President Yoweri Museveni, and his son, Lt Gen Muhoozi Kainerugaba, on Twitter.

He successfully obtained bail from a Kampala court before he was rearrested in unclear circumstances.

His lawyer said he was “kidnapped” from prison by men in plain clothes and taken to an unknown location.

The author won acclaim for his 2020 satirical novel The Greedy Barbarian which describes high-level corruption in a fictional country.

He was awarded the 2021 PEN Pinter Prize for an international writer of courage.

PEN said on Tuesday after his disappearance that it feared for the author’s life – and would hold Mr Museveni, his son and the Ugandan military responsible for “flagrant abuse of office”.