Opposition supporters gather in Istanbul for a protest that marked a triumphant end to a 280-mile march started in Ankara three weeks ago. (Lefteris Pitarakis/AP)

Tens of thousands of Turks came out in force in an Istanbul suburb on Sunday in a direct challenge to their president as they called for an end to a state of emergency that has been in place since a failed coup in July 2016.

The mammoth protest — organized by the opposition Republican People’s Party, or CHP — was a rare display of public dissent in a country where tens of thousands have been jailed as part of a systematic post-coup purge of dissidents and other government opponents. Even small demonstrations in central Istanbul have often been met with a harsh police response.

But Sunday’s rally, which organizers claimed drew more than a million people, marked a triumphant end to a march started by opposition leaders in Ankara three weeks ago.

(Erin Cunningham/The Washington Post)

The lawmakers and others walked from the capital, Ankara, to Istanbul’s seaside — a journey of about 280 miles. That walk, led by the mild-mannered CHP leader Kemal Kilicdaroglu, ended up breathing new life into an opposition that just months ago was on the verge of irrelevance.

Kilicdaroglu, in an uncharacteristically fiery speech on Sunday, called the rally a “new step, a new history, a new birth.” He read out a list of demands for the government of President Recep Tayyip Erodgan, including “giving parliament back its authority” and “releasing jailed lawmakers and journalists.”

Secretary of State Rex Tillerson, who was in Istanbul on Sunday, met with Erodgan and lauded Turkish citizens for taking to the streets a year ago to protest the coup attempt.

“Nearly a year ago, the Turkish people — brave men and women — stood up against coup plotters and defended their democracy,” Tillerson said in remarks at an oil industry conference. He did not mention the Istanbul demonstration, nor did he raise the government crackdown.

In April, Kilicdaroglu failed to mount a successful challenge as a referendum on constitutional amendments granted sweeping powers to Erdogan. Last year, Kilicdaroglu voted along with the president’s party to lift lawmakers’ immunity from prosecution. That move was unpopular among his supporters. But in recent weeks, Kilicdaroglu has inspired ordinary Turks to join his march and voice their concerns about the country’s direction. “We marched for our country. This is just the beginning,” said Aydin Parlak, a 59-year-old retiree from the city of Samsun on Turkey’s Black Sea coast.

“We live in a country that has the highest number of journalists in jail,” he said. “This is the first time in 15 years [since Erdogan came to power] that the opposition party is on the news, that it’s the main topic of conversation in the country.”

Turkey’s political woes have percolated for years, buffeted by a homegrown ethnic Kurdish insurgency and spillover from the Syrian civil war next door. Amid the chaos, Erdogan, an Islamist once lauded as one of the few democratic leaders in the region, began exhibiting authoritarian tendencies. He targeted journalists for articles and tweets that he said “insulted the president.” Rights activists also soon found themselves on trial or in jail.

But it was the coup attempt last summer — when a rogue faction of the military bombed parliament, seized bridges in Istanbul, and tried to assassinate the president — that accelerated the clampdown on dissent. In a bid to root out coup supporters, the government detained tens of thousands and dismissed thousands more from their jobs as judges, professors, police officers and doctors.

Kilicdaroglu, who condemned the coup and extended his support to Erdogan, began his march on June 15, one day after CHP lawmaker Enis Berberoglu was arrested. Berberoglu, a former journalist, was sentenced to prison for providing the independent Cumhuriyet newspaper with a video purportedly showing Turkish intelligence sending weapons to Syrian rebels.

“In a country where more than 150 journalists are in prison, there cannot be even a semblance of democracy,” Kilicdaroglu said Sunday, as he shared his list of demands.

In his speech at the rally, he said the demonstration marked a “new beginning” for the country. “It’s a new climate, a new history, a new birth.”

Some who attended the protest were not as hopeful, though.

“The judiciary is not independent. I’m hopeless about our situation. [Erdogan] is a dictator,” said 41-year-old Gulben Efes, a doctor from Ankara. But, she said, she came to the demonstration “for my children, for my country.”

In the blazing sun, with temperatures nearing 90 degrees, the young and the old, dressed in the red and white of the Turkish flag, chanted for “rights, law, justice!” Demonstrators also donned T-shirts and baseball caps emblazoned with the word “adalet,” Turkish for “justice.” Buses and ferries carried some demonstrators to the venue, in the Istanbul suburb of Maltepe. Police also patrolled the march.

“We did it, we are here,” said Aytug Atici, a CHP lawmaker from the city of Mersin. He walked from Ankara to Istanbul.

“We are looking for justice,” he said. “Since there is no justice in the courts, we are trying to find justice in the streets.”