Turkey's President Recep Tayyip Erdogan has insisted Turkish democracy is not under threat, but said there could be more arrests in the wake of last week's failed coup attempt, in a wide-ranging interview with Al Jazeera.

"We will remain inside a democratic parliamentary system, we will never step back from it," he told Al Jazeera's Jamal Elshayyal, speaking through a translator, from inside the presidential palace in Ankara.

"However, whatever is necessary for the nation's peace and stability will be done," Erdogan said, expressing doubts that the coup attempt was entirely over.

"I don't think we have come to the end of it yet."

Erdogan's comments came moments ahead of announcing a three-month state of emergency in response to the failed coup.

"I would like to underline that the declaration of the state of emergency has the sole purpose of taking the necessary measures, in the face of the terrorist threat that our country is facing," he said in a televised address, vowing that the "virus in the military will be cleansed".

'Crime against Turkish state'

In his interview with Al Jazeera, Erdogan described the attempted coup as "a crime against the Turkish state", adding that the government was making sure "every step is taken within the law".

The Turkish government's purge of state institutions following Friday night's failed coup has already cleared out about 60,000 people.

READ MORE: Thousands of police suspended after Turkey failed coup

This has led rights organisations and Turkey's allies to voice some concern about the direction the country is taking after the coup attempt, with some claiming that the president was using the weekend's events to legitimise the crackdown on any kind of opposition.

Erdogan responded to criticisms about the high number of arrests that followed the coup attempt by giving examples from other countries that faced security threats in the recent past, claiming the Turkish government's reaction was no different.

"For example, in the face of terrorist acts, France took numerous steps and certain stands," he told Al Jazeera.

"Did they not detain people en masse? Did they not arrest people in very high numbers? We cannot deny those situations.

"Three months ago they had an emergency state. Initially it was three months, then it was prolonged."

The Turkish president also repeated his claim that US-based cleric Fethullah Gulen and his movement was behind the coup attempt and said it would be a big mistake if the US decided not to extradite him. Gulen, who lives in exile in the US state of Pennsylvania, has denied any involvement.

But, Erdogan also emphasised that he did not want to strain Turkey's relations with the US as a result of the extradition request.

"We need to be more sensitive," he said. "Relations between our countries are based on interests, not feelings. We are strategic partners."

READ MORE: Thousands on the streets to show support for Erdogan

The Turkish president said he believed foreign countries might have been involved in the failed coup attempt, though he declined to name any.

Erdogan also reiterated Turkey would consider reinstating the death penalty after the failed attempt to overthrow his government.

"I will approve capital punishment if it's passed by parliament," he said.

Turkey abolished the death penalty in 2004 under reforms aimed at obtaining European Union membership.

Reinstatement would create further issues between the EU and Ankara in the already stalled membership talks.

INSIDE STORY: Turkey - Witch-hunt or precautionary measures?

But, Erdogan insisted that Turkey's decision on capital punishment should not affect its relations with the EU.

"If the EU respects democracy it will accept people's will," he said. "The world is not simply the European Union. Do you have capital punishment in the US, Russia, China and in many other countries? Yes."

Highlighted excerpts from Erdogan's interview below:

On how he found out about the coup attempt: "It was my brother-in-law who gave me first the news. Initially my reaction was disbelief ... I had a conversation with the head of the national intelligence agency, I was already with the minister of energy on site and we decided to take a number of steps. One of the first steps involved my family and me taking a helicopter from where we were to Dalaman, and from Dalaman to come to Istanbul by plane.

On arriving in Istanbul: "When we arrived in Istanbul, of course there were some difficult moments there as well ... We had F-16 jets flying in low altitude, faster than the speed of sound; that was, of course, an effort to instill fear in the hearts of tens of thousands of people who were assembled there, and then we sat down with a number of colleagues in positions of authority and we planned the aftermath, what was going to follow."

On potential foreign involvement in the failed coup: "There might be other countries involved as well; the Gulenist terror organisation also has another superior mind, if you will, and a time will come when those connections will be deciphered. We have to be patient ... But I don't think it will take long. The judiciary is acting and I think all of those connections will come to the light of day."

On critics accusing him of a media crackdown: "I have never been against media; there have been numerous insults and libels against me and my family and those outlets are still broadcasting. But in this incident even they said they were on the side of the president, because [a pro-coup] direction would doom them and be the end of them."

On reinstating the death penalty: "If parliament makes that decision, then the duty of the authorities in power is to pave the way for this punishment to be reintroduced. The people have voiced this demand. They took to the streets and kept saying 'capital punishment, capital punishment, capital punishment.'"