Turkey's President Recep Tayyip Erdogan has pledged for the first time that he would immediately lift the almost two-year state of emergency in place since the 2016 failed coup if he is re-elected in this month's polls.

Erdogan declared the state of emergency five days after the July 15, 2016 failed bid to oust him from power. An unprecedented purge that has seen some 55,000 arrested has taken place under the measure.

The state of emergency has become a campaign issue in the June 24 presidential and parliamentary elections, with the opposition Republican People's Party (CHP) and Iyi (Good) Party vowing to end it.

‘After June 24, if I am given the right to continue in office, our first step will be, God willing, to lift the state of emergency,’ Erdogan said in an interview with 24 TV late Wednesday.

His comments came after CHP leader Kemal Kilicdaroglu vowed that its candidate for the presidency Muharrem Ince would lift the state of emergency within 48 hours if elected.

Ince tweeted on Thursday: ‘After the elections I will take the oath and as I take office we will immediately lift the emergency.’

Erdogan had on June 8 said ‘there could be the question of lifting’ the state of emergency after the election but this is the first time he has made such a clear pledge.

The emergency has been criticised by activists who say the measure has been used against all opponents of Erdogan and not just plotters in the coup, which Turkey says was masterminded by US-based preacher Fethullah Gulen. Gulen denies the charge.

Leftist and Kurdish activists have found themselves behind bars including the former head of the pro-Kurdish Peoples' Democratic Party (HDP) Selahattin Demirtas who is running against Erdogan in the elections.

Erdogan indicated that lifting the state of emergency would not necessarily mean an end to the crackdown.

‘Lifting the state of emergency does not mean completely eliminating it or returning back to as we were,’ he added.

‘If we see terrorism, we will again take the strictest measures,’ he said.

Analysts are forecasting that the parliamentary and presidential elections will be tight, with Erdogan possibly set to be pushed into a run-off and with his ruling party at risk of losing its overall majority.