Turkish President Recep Tayyip Erdogan has said the state of emergency that has been in place since July 2016 will be lifted if he is elected in 24 June elections, but suggested it would be reinstated if the country faces further threats.

"Should I continue this task after June 24, the first thing we'll do is, God willing, lift the state of emergency," Erdogan said in an interview with 24 TV on Wednesday night.

"Lifting the state of emergency does not mean abolishing it completely not to come back. We'll take whatever the toughest precaution is again when we see terror."

Under the state of emergency, Erdogan and the government can bypass parliament in passing new laws and also have scope to suspend rights and freedoms. It was declared shortly after a failed coup attempt in July 2016 and has been extended every three months since then.

More than 160,000 people have been detained under the emergency rule and a similar number of civil servants have been sacked from their jobs, the United Nations has said. Scores of media outlets have been shut and many journalists, activists and politicians have been detained.

Critics say Erdogan is using the state of emergency as a pretext to quash dissent. Turkey has said the measures are necessary to fend off the security threats it faces and that the state of emergency does not interfere with the campaign.

Erdogan said in April that businesses should welcome the state of emergency because it guards against terrorism and prevents workers from going on strike.