BANGKOK (Reuters) - A Thai court on Thursday freed on bail a group of activists who led a protest in Bangkok on the anniversary of a 2014 coup, forbidding them from holding another illegal protest, the group’s lawyer said.

Pro-democracy activist Rome Rangsiman (C) holds up a Thailand flag as anti-government protesters gather during a protest to demand that the military government hold a general election by November, in Bangkok, Thailand, May 22, 2018. REUTERS/Athit Perawongmetha

Tuesday’s protest highlighted concern over the military’s prolonged rule and repeated delays in general elections originally promised in 2015, which Prime Minister Prayuth Chan-ocha this week said would be held in 2019.

“May dictatorship be destroyed. May democracy flourish,” one of the protest leaders, Rangsiman Rome, 26, shouted as he walked into court.

The 15 pro-democracy activists had been in police custody since the protest, when most of them surrendered to police, although a handful were forcibly taken away, Reuters reporters said at the time.

“The court agreed to release them on condition that they don’t participate in political gatherings that are illegal again,” the lawyer, Kisadang Nutjarat, told Reuters.

Bail was set at 100,000 baht ($3,123) for each activist.

Police had earlier asked for the men to be held in custody for 12 days during their investigations.

Hundreds of activists had joined in the protest at a university in Bangkok’s old town, near the regional headquarters of the United Nations, to demand a general election in November.

About 3,000 police blocked the demonstrators from marching to Government House, the site of the prime minister’s office.

The protesters later dispersed peacefully after the group’s leaders turned themselves in.

All 15 protesters have been charged with sedition, violating a junta ban on political gatherings of more than five people and illegal assembly that caused violence, among other charges.

They face up to seven years in prison if found guilty.

Rights group Amnesty International urged Thai authorities to drop all charges against them.

“Detaining and charging peaceful protesters makes a mockery of the promise that authorities will lift political restrictions within the next month,” Katherine Gerson, a Southeast Asia campaigner for the group, said in a statement.

The military government plans to meet political parties next month to discuss ground rules for the general election, among them easing curbs on political activities.

As army chief, Prayuth led the 2014 coup the military said was necessary to put an end to months of street protests and political gridlock.