The latest crisis to sweep Egypt has inflicted considerable damage, and now threatens the country's transition to democracy. The rules of political competition have not been followed, and politics has veered towards violence, harming both opponents and supporters of President Mohamed Morsi.

Ostensibly the issue has been Morsi's constitutional declaration. The Muslim Brotherhood – the Ikhwan, or brothers – deemed this declaration necessary to pre-empt a ruling from the constitutional court that would have in effect ended the powers of the president and paralysed the political transition. The ruling would have invalidated the constituent assembly, the body drafting the constitution, and dissolved the consultative council – the only remaining elected body after the same court dissolved parliament in June.

The president has every reason to be sceptical of the court's intentions. All its judges were appointed under Mubarak, and some have never concealed their hostility to the Brotherhood.

The president's declaration was nonetheless a big mistake. By declaring his decisions immune from legal challenge – albeit for a limited period – Morsi angered a large number of judges. Worse, his actions gave rise to the formation of a peculiar alliance between liberals, nationalists and some revolutionary youth groups on the one hand, and what are known in Egypt as felool, or "remnants", on the other. The "remnants" include various people associated with Mubarak's regime, including leading military, security and judicial figures, rural and provincial leaders of the disbanded National Democratic party, and business people who amassed huge fortunes in the Mubarak era. This odd alliance – confirmed by the opposition's co-ordinator, Mohamed ElBaradei in a recent article – believes that the state has been hijacked by the Brotherhood and must be regained at any cost.

Massive rallies and violent clashes followed Morsi's declaration, and the Brotherhood found itself increasingly isolated, with salafist Islamists its only allies. This led to growing political and ideological polarisation.

But the opposition has also made a grave error. Inadvertently, the liberal, nationalist and youth elements in the political opposition have given the remnants an opportunity to return to centre stage. They have allowed their own Ikhwan-ophobia to dominate, giving more weight to their hatred of the Islamist forces than their evident love of democracy. In their desire to topple the Brotherhood – an aim that the liberal leader of the National Salvation Front, Osama Ghazali Harb, admitted last Sunday – they seem prepared to commit the greatest of profanities: to ally themselves with the former regime's forces; they even ignore the violence of the notorious baltagiya, or criminal gangs.

These thugs were used against the revolutionaries of Tahrir Square , with leaders of Mubarak's party and associated business people accused of hiring them. The irony of the latest standoff is that the thugs have been used again to initiate bloody clashes with Morsi's supporters, leading to further attacks and counter-attacks between his supporters and opponents. The Brotherhood claims nine of its members were killed, with more than a thousand injured.

The country is now so polarised that we see two camps without a go-between to mediate, and perhaps reconcile them. When the president called for a national dialogue meeting, it was attended by 54 national leaders and legal figures but boycotted by the representatives of the main opposition forces, who continue to call for more protests.

Here the opposition has made another mistake. Appearing hell-bent on confrontation, it has strengthened the conviction of Morsi's supporters that it was seeking to overthrow the legitimate authority of the democratically elected president. This impression was reinforced when opposition leaders escalated their confrontational rhetoric even after the abolition of the declaration, calling for the postponement of the referendum on the constitution, scheduled for next Saturday. This was percieved by many Egyptians as contempt for the will of the people – an impression reinforced when one of the most prominent liberal intellectuals, Alaa Al Aswany, suggested that all illiterates should be banned from voting in the referendum: 26% of Egypt's population is illiterate, and 33% of women.

The demand that the referendum be postponed is not based on substantive objections to the constitution. Many opposition figures were involved in drafting it before their withdrawal. And Morsi has committed to ask the new parliament to amend disputed clauses according to a national dialogue, which he said should start immediately.

A more credible basis is that the opposition is acutely aware that opinion polls show that the majority of Egyptians would vote yes to the draft constitution. This would amount to a renewal of the legitimacy of the president and a political defeat for the opposition. It is trying to avoid this by insisting on postponement, but is unlikely to succeed.

This battle is unlikely to be the last in Egypt's political transition. The internal political scene is complex, and made more so by external interference – either by those who worry that a successful Egypt may restrict their regional colonial or expansionist ambitions, or would encourage their own people to revolt.

The acrimony underscores the need to build consensus on the rules of political conduct, based on the recognition of political diversity and the rejection of violence. The opposition must get used to the fact that Islamists are an organic part of Egyptian political life. Attempts to exclude them would not propel the liberals or nationalists to power but plunge the country into violence and extremism.

As for the Muslim Brotherhood, it must become comfortable with political engagement. It must be open to all components of society in order to reassure sceptics that it does not intend to change the rules of democratic politics. It must give assurances that it will not seize exclusive authority over Egypt for itself and its allies. Numerical majority in a nascent democracy is not a mandate for authoritarianism.