Egypt was thrown into fresh turmoil on Monday when President Mohamed Morsi's aides indicated he would not give in to the threat of a military coup just hours after the army gave him two days to placate the millions who have taken to the streets calling for his departure.

The head of Egypt's armed forces, General Abdel Fattah al-Sisi, threatened direct military involvement in the political process "if the demands of the people are not met", in a statement implying that Morsi should either step down or at least call early elections.

The presidency indicated that it viewed the statement as a coup d'etat. "Obviously we feel this is a military coup," a presidential aide said. "But the conviction within the presidency is that [the coup] won't be able to move forward without American approval."

According to a statement on the president's official Facebook page, Morsi met Sisi along with the prime minister late on Monday.

As the night wore on, Morsi's position seemed ever more untenable, with the Ministry of the Interior announcing its "complete solidarity" with Egypt's armed forces, and the army taking control of local government headquarters in Fayoum, a governorship south of Cairo.

An army spokesman denied it was capable of a military coup, saying that it acted only in the will of the people.

The comments from Morsi's aide earlier in the day implied that the presidency was hopeful of continued US support. They also suggested the presidency was banking on the likelihood that the military would not risk upsetting the US, which provides it with significant funding.

The army statement said: "The armed forces warns everyone that if the demands of the people are not met during this set time period, it will be obliged … to announce a roadmap and measures for the future, which it would oversee in collaboration with all the loyal national factions and movements, including the youth who were and remain the spark of the glorious revolution. No one would be ignored."

On Monday, the US president, Barack Obama, indicated that Morsi had not yet lost his backing. "We don't make those decisions just by counting the number of heads in a protest march but we do make decisions based on whether or not a government is listening to the opposition, maintaining a free press, maintaining freedom of assembly, not using violence or intimidation, conducting fair and free elections," he said.

But in Egypt, events suggested the tide had already turned, with 10 cabinet ministers resigning and the headquarters of the Muslim Brotherhood, the group from which Morsi hails, burnt and ransacked in an all-night siege.

In an episode reminiscent of the sacking of Hosni Mubarak's political headquarters during Egypt's 2011 uprising, about 50 anti-Brotherhood protesters spent the night attacking the compound – situated on a rocky, isolated outcrop in east Cairo – with molotov cocktails, causing a series of small fires and explosions.

At about 7am, after 12 hours of fighting, those inside fled, allowing the protesters to storm the compound. Once the worst of the fire was put out, hundreds re-entered the building, looting and destroying its remaining features.

"It's a great feeling. I've wanted to do this for three years," said Ahmed Yassin, a student from Alexandria, holding the office name tag of Mohamed el-Badie, the Brotherhood's leader. "Their offices are being trashed all over Egypt – but this was the most important, because they are running the country from this office."

Others took air-conditioning units, safes, sinks, and filing cabinets – as well as the copper name tags of Badie and Khairat al-Shater, the Brotherhood's most powerful figure.

Inside, there was chaos, with black smoke still billowing through the upper rooms and looters fighting over the spoils. Outside, a crowd of 200 chanted "the people demand the fall of the regime".

"I feel victorious," said Ahmed Badawy, a Cairo resident shot in the hand by birdshot fired by Brotherhood members during the night. "But we'll only have truly won once Morsi leaves."

As evening approached, Tahrir Square was a scene of jubilation as the possibility of renewed military involvement in politics was greeted enthusiastically by many protesters, who have lost trust in the presidency and its top-level opposition. Hundreds of thousands flooded the square in celebration at the news, and others set off fireworks. Military helicopters flying overhead were greeted with cheers and chants of "the army and the people are one hand".

One Egyptian television channel started a ticker counting down the hours until the coup. "It's the only institution capable of running the country," said Ahmed Mahmoud, a bank clerk protesting outside the presidential palace in north-east Cairo.

The National Salvation Front (NSF), Egypt's largest opposition grouping, greeted the announcement warmly, hoping that it may pave the way for their greater involvement in government. "We hugely appreciate the statement from the armed forces because it shows that our military will always be a part of the Egyptian people," said Hussein Abdel Ghany, an NSF spokesman.

In recent days, Cairo supporters of Morsi had confined their 100,000-strong rallies to one stretch of road in east Cairo. But as midnight approached last night, thousands of Islamists began to gather elsewhere in the capital.

Women's rights groups reported 17 cases of sexual harassment during protests in central Cairo, bringing the total since protests started to over 60.

Morsi's opponents are by no means homogenous. Many are horrified at the prospect of replacing one dictatorial regime with another. Considering it counter-revolutionary, they fear a repeat of the repressive military junta that ruled for 18 months following the fall of Mubarak. "There's plenty to be depressed about," tweeted Tarek Shalaby, an Egyptian activist.

Burnt by their failings during this period, the army is unlikely to want as hands-on a political role as before. "It's not going to be a full-on military coup with the army taking on full-on authority," said Michael W Hanna, fellow at the Century Foundation and an analyst of Egyptian politics. "They want to see some sort of mechanism that does not mean General Sisi has to head of a government."

Many hope the army will set up an interim technocratic cabinet to supervise the rewriting of Egypt's divisive Islamist-slanted constitution, whose drafting Morsi unilaterally forced through last November, and new presidential elections.

But others warned that any scenario in which Morsi was forced from power would have dire consequences within Islamist sections of society. "Many Islamists – not just in the Brotherhood – would be out of control," said Khalil al-Anani, a specialist on Islamist politics at Durham University."For them, this would be a coup against not just the president but against Islam as they perceive it – and this is one of the problems facing Morsi at the moment. He can't satisfy the opposition if he doesn't step down, nor his social base if he does."

Anani said Morsi's downfall would drive young Islamists towards extremism and violence. He said it could also spark recriminations between senior members of the Brotherhood, who would seek to blame each other for Morsi's failure, and even lead to the Brotherhood's breakup.