Tens of thousands of supporters of Turkey's ruling and main opposition parties, usually bitter foes, rallied together today in support of democracy following a failed military coup as President Tayyip Erdogan tightens his grip on the country.

Demonstrators held a cross-party 'Republic and Democracy' rally in Istanbul's central Taksim Square in a spirit of unity following the failed coup, in which at least 246 people were killed and more than 2,000 injured.

In a rare move, pro-government channels broadcast a live speech from the podium by main opposition leader Kemal Kilicdaroglu.

"This is a day to unite, a day to stand up against coups and dictatorial regimes, a day to let the voice of the people be heard," he said at the rally, organised by his secularist opposition CHP but also backed by the ruling Islamist-rooted AK Party and by other opposition groups.

"We are all together in Taksim today. Today is a day we made history all together."

Mr Erdogan will probably try to capitalise on the large size of the crowd of all political persuasions to try and reassert full control over the country.

In another demonstration of unity after the coup, which was staged by a faction within the armed forces, the head of Turkey's air force issued a rare statement stressing "absolute obedience" to the chief of the military General Staff. Some members of the air force were involved in the coup.

The chief of the military General Staff, Hulusi Akar, who was held hostage by the plotters on the night of 15 July, condemned the plotters today as "cowards in uniform" who had greatly harmed the nation and the army.

Mr Erdogan, who narrowly escaped capture and possible death during the attempted coup, has declared a state of emergency, allowing him to sign laws without prior parliamentary approval in a drive to root out supporters of the coup.

His critics fear he is using the abortive coup to wage an indiscriminate crackdown on dissent. Turkish authorities have suspended, detained or placed under investigation more than 60,000 soldiers, police officers, judges, teachers, civil servants and others in the past week.

Prime Minister Binali Yildirim said today that authorities had taken around 13,000 people into custody over the coup attempt, including 8,831 soldiers. He pledged they would have a fair trial.

Rights group Amnesty International said it had received credible evidence of detainees being subjected to beatings and torture, including rape, since the coup attempt.

"It is absolutely imperative that the Turkish authorities halt these abhorrent practices and allow international monitors to visit all these detainees in the places they are being held," said Amnesty's Europe director John Dalhuisen in a statement.

Soldiers patrol at Turkish rally

Mr Erdogan has extended the maximum period of detention for suspects from four days to 30, a move Amnesty said increased the risk of torture or other maltreatment of detainees.

Mr Erdogan has accused US-based Muslim cleric Fethullah Gulen, who has many followers in Turkey, of masterminding the abortive coup.

In his first decree, Mr Erdogan ordered the closure of thousands of private schools, charities and foundations with suspected links to Mr Gulen, who denies involvement in the coup.

The CHP and other political parties swiftly joined the ruling Islamist-rooted AKP in condemning the coup attempt, mindful of four other military interventions in Turkey in the past 60 years.

The last full-scale coup in 1980 led to mass arrests of politicians and others, torture and executions.