The leader of Turkey's main opposition party has completed his 25-day "March for Justice" from the capital Ankara to Istanbul, joining his supporters at a rally against a judicial decision against one of his party members.

Kemal Kilicdaroglu, the head of Republican People's Party (CHP), told the demonstration on Sunday that the march was "a new beginning".

"No one should think the end of this march is the end. This march was our first step," Kilicdaroglu said. "July 9 is a new step. July 9 is a new climate. July 9 is a new history."

Kilicdaroglu launched 450km trek on June 15 when CHP's Enis Berberoglu was sentenced to 25 years in prison.

He was convicted of revealing state secrets by giving the Cumhuriyet newspaper information on the transportation of arms to Syria in January 2014.

READ MORE: Erdogan criticises CHP's 450km march

Turkey's President Recep Tayyip Erdogan criticised Kilicdaroglu when he launched his protest march, saying justice should be sought in parliament, not on the street.

He also said that Kilicdaroglu was trying to influence the judiciary through the trek which was against the law.

Sunday's rally was guarded by 15,000 police officers, who were deployed by Istanbul Governor Vasip Sahin to safeguard the demonstrators.

The US consulate issued a security message asking its citizens to exercise caution as "terrorists have targeted political rallies in the past, and that demonstrations and large events intended to be peaceful can turn confrontational and escalate into violence".