Updated

Turkey's main opposition party set off on a 425-kilometer (265-mile) march Thursday from the capital to an Istanbul prison to protest the conviction of one of its lawmakers. Thousands took to the streets in Ankara, drawing criticism from the country's president.

The leader of the pro-secular Republican People's Party, Kemal Kilicdaroglu, called the "march for justice" after parliamentarian Enis Berberoglu was convicted and sentenced to 25 years for revealing state secrets.

wh turkish

Kilicdaroglu said the verdict was "palace-motivated," a reference to President Recep Tayyip Erdogan.

"Let the whole world hear, we are facing a dictatorial regime in Turkey, in our own land," he said.

At a dinner to break the Ramadan fast in Ankara, Erdogan criticized the march, saying the protesters should not forget a constitutional article on the independence of the judiciary.

"Everyone should know their place," Erdogan said. "No one wins a thing when they, on the one hand, say they respect law and then go on the path of breaking the law ... they won't win anything with this and on the contrary, it will make them lose."

The case of Berberoglu, a former journalist and lawmaker, stems from a 2015 story by the Cumhuriyet newspaper suggesting Turkey's intelligence service had smuggled weapons to Islamist rebels in Syria. His lawyer has appealed the verdict.

Berberoglu was accused of giving journalists footage that showed local authorities searching Syria-bound trucks allegedly carrying mortar rounds and getting into a standoff with Turkish intelligence officials. Turkish leaders denied supporting Islamic rebels and said the trucks contained aid to Turkmens in Syria.

Can Dundar, Cumhuriyet's then editor-in-chief who is now abroad, and the paper's Ankara representative, Erdem Gul, are also on trial on similar charges.

Separately, the three are being tried for "aiding a terror organization without being members," a reference to the network of U.S.-based cleric Fethullah Gulen, accused by Turkey of orchestrating last year's bloody coup attempt. Gulen has denied the claims. The prosecution believes Gulen's network to be the source of the leaked images.

After the verdict, Kilicdaroglu tweeted: "In this country, the punishment for covering the news of a truck filled with weapons heading to terror groups is 25 years in prison but illegal arm shipments are allowed!"

Berberoglu is the first legislator from the Republican People's Party to be imprisoned since a constitutional amendment stripped parliamentary immunities last year. A dozen pro-Kurdish lawmakers are already in prison for allegedly supporting terror and more than 50,000 people have been arrested for purported links to Gulen.

Kilicdaroglu, 68, said he would walk to Istanbul over an estimated 25 days and will be joined by party members in each province.

Hundreds of people also gathered in an Istanbul park on Thursday morning.

"We want justice! We want a state of law, fair trials. We want democracy, more democracy!" said Birsen Ayisik, a 53-year-old protester.