Istanbul (AFP) - Hundreds of thousands of Turkish opposition supporters on Sunday thronged an Istanbul square to mark the end of a nearly month-long march protesting alleged injustices under President Recep Tayyip Erdogan, in a rare challenge to him.

A sea of people filled the vast shoreside square in Maltepe on the Asian side of Istanbul, celebrating the culmination of a 450-kilometre (280-mile) "justice march" from Ankara to Istanbul by Republican People's Party (CHP) leader Kemal Kilicdaroglu.

The rally is by far the biggest by the opposition seen in Istanbul since the mass May-June 2013 demonstrations against Erdogan's rule.

Kilicdaroglu began the 25-day walk to protest the arrest of one of his MPs. It rapidly grew into a major march against alleged injustices under a state of emergency imposed following last year's July 15 failed coup.

"Nobody should think this march is the last one. It's the first step," Kilicdaroglu told crowds who roared back with the cry "Justice!".

"Everyone should know very well that July 9 is a new step, a new history... a new birth," he added.

Usually, only Erdogan can mobilise crowds on such a scale with glitzy rallies and the president himself had in the past held mass meetings for supporters in the Maltepe meeting area.

- 'Gandhi march' -

The government has dismissed the march as a stunt while a riled Erdogan has accused Kilicdaroglu of siding with "terrorists" and the July 15 plotters.

But Turkish security forces did nothing to impede the march's progress and 15,000 police were deployed at the rally to ensure safety.

CHP officials told AFP that numbers at the rally could be more than two million but this could not be immediately confirmed.

Supporters have compared the trek of the slightly built, mustachioed 69-year-old with Indian independence leader Mahatma Gandhi's famous Salt March of 1930.

Since leaving Ankara, the opposition chief has dressed every day modestly in a white shirt, dark trousers, with a hat to protect him from the sun. He rested at night in a caravan.

Story continues

Kilicdaroglu said he had marched for all of Turkey's population of nearly 80 million.

"We have written history, we have written a legend. It's you who has written history," he told the cheering crowds.

Kilicdaroglu had launched the march from Ankara after his party's lawmaker Enis Berberoglu, a former journalist, was sentenced to 25 years in jail on charges of leaking classified information to a newspaper.

Kilicdaroglu had said he wanted no CHP insignia at the rally, only "Justice" slogans and pictures of modern Turkey's founder Mustafa Kemal Ataturk.

At the rally the huge stage, flanked by pictures of Ataturk and the Turkish flag, had only a single word printed on its canopy -- "Adalet" (Justice) -- in giant letters.

- 'We marched for justice' -

About 50,000 people have been arrested under Turkey's state of emergency and another 100,000 have lost their jobs, including teachers, judges, soldiers and police.

"We marched for justice, we marched for the rights of the oppressed. We marched for the MPs in jail. We marched for the arrested journalists. We marched for the university academics dismissed from their jobs," said Kilicdaroglu.

"We marched because the judiciary is under a political monopoly," he added.

Kilicdaroglu has strongly condemned the failed coup bid -- blamed on US-based preacher Fethullah Gulen, who denies the charges -- but has been bitterly critical of the scope of the state of emergency.

In the latest crackdown, police on Wednesday detained Amnesty International's Turkey director and other activists on charges of membership in a terror group.

Kilicdaroglu said he was against both a "one man regime" and Gulen.

"We want the return of powers grabbed from the parliament," said Kilicdaroglu. "Who dares turn this country -- which is like heaven -- into a hell!" he added.

Turkish police this week detained six suspected members of the Islamic State extremist group planning a bomb attack on the march. But the CHP said it was a routine operation, and was not related to the justice march.