The chief justice of Egypt's Supreme Constitutional Court was sworn in Thursday as the nation's interim president, taking over hours after the military ousted the Islamist President Mohammed Morsi.

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, Mansour 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, Mansour praised the massive street demonstrations that led to Morsi's ouster. 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."

Mansour replaces Morsi, who was Egypt's first democratically elected president but was overthrown by the military on Wednesday after just one year in office. Morsi is under house arrest at an undisclosed location.

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

On Thursday, Egyptian security officials say the Muslim Brotherhood's supreme leader has been arrested in a coastal city and flown to Cairo on a military helicopter.

The officials said Mohammed Badie was arrested Wednesday 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.

The officials spoke Thursday on condition of anonymity because they were not authorized to speak to the press.

Ousted President Mohammed Morsi hails from the Brotherhood, of which he was a longtime leader.

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

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