A university researcher jailed last month in Uganda for allegedly insulting President Yoweri Museveni on Facebook has been granted bail.

Stella Nyanzi entered the packed courtroom Wednesday looking frail. The typically outspoken activist had to be supported by three female wardens.

Nyanzi collapsed during the break before Magistrate James Eremye read his ruling.

“Exercising my discretion, I proceeded to allow the accused her bail, but on the following conditions; one, the accused shall execute a bond 10 million shillings not cash…,” said Eremye.

Nyanzi's bail comes after four weeks behind bars. Nyanzi was arrested and charged with cyber harassment and offensive communication over a Facebook post in which she allegedly called President Yoweri Museveni “a pair of buttocks.”

The post was part of an online campaign Nyanzi had launched calling on the president to live up to his campaign promise to provide free sanitary pads to poor girls.

Human rights lawyer Nicholas Opio represented Nyanzi before the court. He said she suffers from hypertension and has had a bout of malaria.

“We are happy that the court has finally released Stella on bail. We pray that the authorities do respect the orders of the court and not seek to re-arrest Dr. Stella," said Opio. "Now that she is out, we will have a proper discussion on how to respond on the case before court.”

Before the magistrate’s ruling, the state attorney, Jonathan Muwaganya, made his conditions for Nyanzi’s bail application clear.

“Right now she is alleged to be sick, but your worship, should you find that release of the applicant is tenable at this stage, she should be required to refrain during the subsistence of the case from making any adverse cyber attacks or any derogatory statements against the person of the victim in court or his close members of his household,”Muwaganya said.

In a statement Wednesday, Amnesty International called the charges against Nyanzi “ludicrous” and "an affront to freedom of expression." Amnesty said the charges should be dropped immediately.