Secular and Islamist political groups that pushed for the ouster of Egyptian President Mohamed Morsi battled Sunday about the direction of the nascent new order, quarreling over the role of political Islam in a country that just underwent a revolt against one version of it.

After thousands of protesters filled public squares, staging competing rallies to celebrate Morsi’s ouster or demand his return, the victorious factions of last week’s coup — liberals and ultraconservative Salafists — fought over who should lead the country before new elections can be held.

The military and its backers on Wednesday appointed a supreme court justice, Adly Mansour, to serve as a caretaker president. Since then, the fight has been over who will fill the offices of interim prime minister and other cabinet positions. Those officials will steer the country toward elections and, most likely, a new or much amended constitution, potentially giving whoever is chosen an enduring legacy even if their tenure in office is brief.

The dispute centered on the role for Mohamed ElBaradei, a Nobel Peace Prize winner, former diplomat and liberal politician whom ultraconservative Islamists deeply distrust.

On Saturday, ElBaradei’s appointment as prime minister seemed imminent, but fierce opposition from the ultraconservative Nour party forced a reconsideration. Liberal organizers of the anti-Morsi protests, meanwhile, said ElBaradei was the only person they would accept as their leader.

Late Sunday, state media reported that Ziad Bahaa Eldin, a PhD graduate of the London School of Economics and former head of the Egyptian Financial Supervisory Authority, was a possible compromise choice as prime minister, with ElBaradei in the role of vice president. But it was clear that negotiations were continuing.

Bahaa Eldin, analysts said, would serve more as a competent technocrat than as a political leader.

While the political wheeling and dealing was underway, Tahrir Square was packed with Morsi opponents, who cheered as military helicopters buzzed them and fighter jets drew hearts in the sky.

Many posters condemned President Obama, who protesters said is on the side of the Muslim Brotherhood. Others condemned CNN for calling the events of the past week a coup and at one point mislabeling an anti-Morsi protest in Tahrir Square as a pro-Morsi rally. A CNN reporter said Sunday on Twitter that the network was unable to broadcast reports from the square because journalists feared for their safety.

Many people in Tahrir Square said they saw little role for any form of political Islam in the country, leaving open the question of how Islamists would be represented in a future Egyptian state. Several people said they were against the Salafist Nour party even though it officially supported the uprising against Morsi.

“I wish it would disappear,” said Ashraf Samir Abdel Bakki, 45, a tourism representative. “I’m against any mixing of religion and politics.”

But Morsi supporters said they would not back down from their demands to restore the former leader to office. The Muslim Brotherhood, fresh out of a year in power, mobilized demonstrations, and its supporters vowed not to abandon their quest to regain public offices that they said had been stolen from them.

Military rule in Egypt

“We won’t leave the streets. We’ll die in the streets. We don’t know what future there is without him,” said Mohamed Mahmoud, a school principal from the Nile Delta town of Tanta, who was marching with several thousand people toward the Ministry of Defense to protest the military’s role in ousting Morsi.

Once they arrived, some taped images of Morsi to the outside of the building. Military helicopters flew overhead, but they were jeered, unlike in Tahrir Square.

Morsi is allowed to make occasional phone calls to his family to let them know that he is all right but is otherwise being held incommunicado by the military, said Ahmed Diab, a Morsi ally and former member of the now-dissolved parliament.

In Washington, Egypt’s ambassador to the United States, Mohamed Tawfik, denied that the military’s removal of Morsi constituted a coup.

“Egypt has not undergone a military coup, and it is certainly not run by the military,” Tawfik said on ABC’s “This Week.”

The ambassador said Morsi had no one to blame but himself. “He whipped up religious fervor among his supporters, and there was violence in the air,” Tawfik said. “After more than 20 people have been killed, leaders from Egyptian parties, from Egyptian religious establishments, from the military — they came together. They said we have to stop this. Otherwise, violence will spiral out of control.”

Tawfik said Morsi’s Muslim Brotherhood allies should be permitted to participate in the political process. “There is room for everyone in Egypt,” he said, “but there is no room for violence, there is no room for incitement to hatred and incitement to commit acts of violence.”

Abigail Hauslohner, Amro Hassan and Lara El Gibaly contributed to this report.