The supreme leader of Egypt’s Muslim Brotherhood has been arrested and flown to Cairo on a military helicopter, security officials say.

The move came as the chief justice of Egypt’s Supreme Constitutional Court was sworn in as the nation’s interim president, taking over hours after the military ousted the Islamist President Mohammed Morsi, who was a longtime leader of the Brotherhood.

Mohammed Badie was arrested last night in a resort village in Marsa Matrouh, a Mediterranean coastal city west of Cairo not far from the Libyan border. He had been staying in a villa owned by a businessman with Brotherhood links.

Mr Badie is on a wanted list of more than 200 Brotherhood officials and leaders of other Islamist groups.

Prosecutors ordered the arrest of Mr Badie and his powerful deputy Khairat el-Shater for the killing of eight protesters in clashes outside the group’s Cairo headquarters.

The two men have been widely believed to be the source of real power in Egypt during the rule of Mr Morsi, who hails from the Brotherhood.

Earlier the chief justice Adly Mansour took the oath of office at the Nile-side Constitutional Court in a ceremony broadcast live on state television. According to military decree, he will serve as Egypt’s interim leader until a new president is elected. A date for that vote has yet to be set.

In his first remarks, Mr Mansour praised the massive street demonstrations that led to Mr Morsi’s removal. He also hailed the youth behind the protests that began on June 30, saying they embodied “the nation’s conscience, its ambitions and hopes”.

“The most glorious thing about June 30 is that it brought together everyone without discrimination or division,” he said. “I offer my greetings to the revolutionary people of Egypt.”

Dressed in a dark blue suit and blue tie, Mr Mansour said the revolution must continue “so we stop producing tyrants”.

“I look forward to parliamentary and presidential elections held with the genuine and authentic will of the people,” he said. “The youth had the initiative and the noblest thing about this glorious event is that it was an expression of the nation’s conscience and an embodiment of its hopes and ambitions. It was never a movement seeking to realise special demands or personal interests.”

Mr Morsi was Egypt’s first democratically elected president but was overthrown by the military yesterday after just one year in office. He is under house arrest at an undisclosed location.

The military, in a statement read by army chief Gen. Abdel-Fattah el-Sissi last night, also suspended the Islamist-drafted constitution and called for new elections. Mr Morsi has denounced the action as a “full coup” by the generals.

Millions of anti-Morsi protesters around the country erupted in celebrations after the televised announcement by the army chief. Fireworks burst over crowds in Cairo’s Tahrir Square, where men and women danced, shouting, “God is great” and “Long live Egypt.”

That fact that Egypt’s interim president comes from the Constitutional Court adds a symbolic sting to Mr Morsi’s removalr.

The Islamist leader and his Muslim Brotherhood backers had repeatedly clashed with the judiciary while in power, accusing the judges of being loyalists of former autocrat Hosni Mubarak, who was ousted in a 2011 uprising, and saying they seek to undermine Egypt’s shift to democratic rule.

The judges, meanwhile, had repeatedly challenged the Brotherhood’s policies and what many in Egypt considered the group’s march to power. The Constitutional Court dissolved the Islamist-dominated parliament in June last year, saying it was illegally elected.

Even with an interim leader now in place, Egypt remains on an uncertain course following Mr Morsi’s ousting, and the possibility of further confrontation still looms. Beyond the fears over violence, some protesters are concerned whether an army-installed administration can lead to real democracy.