CAIRO (Reuters) - An Egyptian human rights lawyer and would-be presidential election candidate is to stand trial next week charged with offending public decency, his lawyer said on Wednesday.

File Photo - Egyptian lawyer and ex-Presidential candidate Khaled Ali (C) reacts in front of the State Council courthouse in Cairo, Egypt, January 16, 2017. REUTERS/Mohamed Abd El Ghany

Khaled Ali, 45, was detained on Tuesday in what rights group Amnesty International said was part of a campaign of intimidation aimed at discouraging participation in the election, due to take place next summer.

A prosecutor on Wednesday released Ali on bail and set his trial for May 29, Ali’s lawyer Malek Adly said.

The charge he faces relates to a photograph in which he appears to make a rude hand gesture on the steps of a Cairo court house, according to Adly. Ali denies the authenticity of the photo.

“This is all connected to his human rights and political work,” said Adly, a member of Ali’s leftwing Bread and Freedom Party. “We are being punished for practising clean politics, and yes, we intend to run, which is why we are facing this campaign.”

If convicted, Ali could face up to two years in prison, a fine of up to 5-10,000 Egyptian pounds ($250-550), or both. He would also be barred from running for the presidency.

Since toppling Mohamed Mursi of the Muslim Brotherhood in 2013, President Abdel Fattah al-Sisi has overseen a crackdown against Islamists and secular opponents in which hundreds have been killed and thousands jailed.

Sisi, 62, says he is a bulwark of stability in a region that has slipped into chaos since the 2011 Arab Spring revolts, prioritizing security over civil rights.

He is widely expected to stand for re-election next summer.

Dozens of lawyers gathered at the courthouse where Ali was being questioned on Wednesday in a show of solidarity.

The Bread and Freedom Party’s legal adviser has said that eight of its members have been detained since April on charges including “misusing social media to incite against the state” and “insulting the president”.

Ali’s defense team paid bail worth 1,000 pounds ($55) after his release was ordered, his lawyer said.

Amnesty International said detention and referral to trial were part of a crackdown on opposition activists ahead of the election.

“The Egyptian authorities seem intent on pre-emptively crushing any potential rivals to maintain their grip on power,” Najia Bounaim, Amnesty International’s campaigns director for North Africa, said in a statement.

Separately on Wednesday, a rights activist, Mohamed Zaree, was questioned in relation to a high-profile case in which non-governmental organizations are accused of receiving foreign funding to foment chaos.

Zaree told Reuters he had been charged with “receiving funds from foreign entities to harm national security” before being released on bail of 30,000 pounds.