Turkish President Recep Tayyip Erdogan has announced that the country will be placed under a "state of emergency" for three months, in response to the failed coup.

In a televised address on Wednesday, Erdogan said the decision was made following a meeting with members of the national security council.

The state of emergency was needed "in order to remove swiftly all the elements of the terrorist organisation involved in the coup attempt," he said at the presidential palace in Ankara.

READ MORE: The lessons to be learned from Turkey's 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, vowing that the "virus in the military will be cleansed".

In an interview with Al Jazeera earlier on Wednesday, Erdogan has expressed doubts the coup attempt was entirely over.

"I don't think we have come to the end of it," he said.

Presidential power

Turkey has accused the group of US-based cleric Fethullah Gulen of being behind the coup.

Gulen has strongly denied links to the coup.

According to the Turkish constitution, a state of emergency is allowed up to six months.

Article 120 of the constitution allows a state of emergency to be imposed "at a time of serious deterioration of public order because of acts of violence".

Turkey had in 2002 lifted its last state of emergency, which had been imposed in provinces in the southeast for the fight against Kurdish armed groups in 1987.

Under a state of emergency in Turkey, the president can largely rule by decree.

Curfews could be enforced, and gatherings and protests could be banned without official consent, under the declaration.

Media could also be restricted, while security personnel could conduct searches of persons, vehicles or properties and confiscate potential evidence.

But the interior ministry said that the order "will not affect civilians", according to Al Jazeera's Stefanie Dekker, who was reporting from Ankara.

In his televised address, Erdogan also tried to reassure the public that military powers will not be expanded, adding that Turkey would emerge as a "stronger nation" following the coup attempt.