DHAKA (Reuters) - A court in Bangladesh granted bail on Thursday to photographer and social activist Shahidul Alam, his lawyer said, in a case widely seen as a test for freedom of speech ahead of a general election next month.

Journalists, activists and students of Pathshala South Asian Media Academy protest against the arrest of Bangladeshi photojournalist Shahidul Alam in Dhaka, Bangladesh, August 11, 2018. REUTERS/Mohammad Ponir Hossain

Alam, who has not been charged, was arrested in August on suspicion of spreading “propaganda and false information” during widespread student protests.

Police were investigating the award-winning photographer under a controversial section of the law on information and communication technology that carries a maximum jail term of 14 years, sparking criticism from rights groups.

“We’re delighted that ultimately the court has granted him bail,” said the lawyer, Sarah Hossain, adding that she expected her client to be released soon.

The government’s top lawyer said it would appeal the High Court decision.

“We will soon appeal to the Supreme Court against this bail decision,” Attorney General Mahbubey Alam said, adding Shahidul Alam had lowered the government’s image through his propaganda.

Alam, 63, was picked up from his home hours after an interview with television channel Al Jazeera in which he accused the government of extrajudicial killings and corruption - accusations the government dismissed.

He had also been critical of government on social media.

Last month, Prime Minister Sheikh Hasina told Reuters that she was convinced Alam instigated trouble by spreading what she called false news about protests against her rule in August. His family and lawyer rejected the accusations.

Under Hasina, the country has adopted a law to punish media that publish or broadcast anything deemed to be against the public interest, a move journalists fear could further stifle press freedom.

Bangladesh goes to the polls on Dec. 30.