Tens of thousands of people have attended an "anti-terrorism" rally in Istanbul, as an armed conflict between the army and Kurdish rebels keeps taking lives on almost daily basis in the country.

The huge crowd thronged Yenikapi Square on the shores of the Marmara Sea for the demonstration, which was culminated with an address by Turkish President Recep Tayyip Erdogan.

On Thursday, thousands took part in a similar rally in the capital Ankara to denounce the Kurdistan Workers' Party (PKK), which has killed dozens of police and soldiers in a string of attacks in the mainly Kurdish southeast.

The PKK and the Turkish state had been engaged in peace talks and a ceasefire had been in place since 2013 before it collapsed last July. Turkey began an air campaign against the PKK inside the country and in northern Iraq in the same month.

Many of the demonstrators wore red headbands that eulogised the slain security force members as "martyrs" and waved Turkish flags.

"Martyrs never die, the homeland cannot be divided," the headbands read.

Turkey’s two-month-old offensive against the outlawed PKK comes as the country prepares for a November 1 general election.

Sea of flags

No political emblems were visible among the sea of red Turkish flags in Istanbul but many of the demonstrators expressed fervent support for conservative Justice and Development Party (AK Party), founded by Erdogan.

The AK Party is looking to the upcoming election to reverse the losses it sustained in the last election in June, which stripped it of its governing majority, forcing it into coalition talks that ended in failure.

The big winner of that vote was the pro-Kurdish Peoples' Democratic Party (HDP) which took votes from the AK Party to win seats in parliament for the first time as a political party, but not through independent.

The government has accused the HDP of being a front for the PKK, allegations the party - which also enjoys support among non-Kurds - rejects.

Over 120 soldiers and police have been killed in rebel attacks since the escalation began, according to the Turkish media. The government for its part claims to have killed over a thousand rebels in air strikes and ground operations in northern Iraq and southeast Turkey.

Over 40,000 people have been killed in the more than three decades of fighting between PKK and the Turkish security forces.

Source: Al Jazeera and agencies