Egyptians witnessed their nation’s first democratic handover in history on Saturday with the swearing-in as president of Islamist Mohamed Morsi, who displayed a striking synergy with and reverence for the military chiefs who have ruled the country since last year’s revolution.

The day’s events, rich in pageantry and broadcast on state television, provided a stark illustration of the extraordinary role reversals that have taken place at the top of Egypt’s government. When Morsi arrived Saturday afternoon at a base outside Cairo where, just years ago, fellow members of his Muslim Brotherhood movement were tried by military tribunals, Egypt’s top general, Mohammed Hussein Tantawi, bowed and saluted the new president.

Morsi, 60, who was himself detained for anti-government activism under his predecessor’s autocratic rule, called on Egyptians to forget the “ugly pages” of the past. In a speech at the University of Cairo, he commended the ruling generals for steering the country during a trying transitional period, eliciting applause from the graying, uniformed officers seated in the front rows.

If Morsi’s relationship with Egypt’s revered military is to become an unlikely marriage of convenience, as many Egyptians foresee, both sides pulled off flawless ceremonies marking the union Saturday with words of praise for the generals from Morsi and reverential gestures, a military parade and a 21-gun salute for him from the generals. But it is a relationship that will be tested by myriad unresolved questions and challenges over the next months and years.

“It’s a very symbolic moment and a very emotional moment for some people,” said Michael Wahid Hanna, an Egypt expert at the Century Foundation in New York. “But when you peel away the layers of symbolism, the stark reality remains the same. The battle for civilian authority will last years.”

Diminished power

Morsi is the first president in Egypt who does not hail from the armed forces. He is also the most powerless in the country’s history, as a result of a constitutional decree the Supreme Council of the Armed Forces issued last month stripping the president of his role as commander in chief. This makes it all but certain that the generals and Morsi will clash as Egypt’s power spheres, which for decades propped up a dictator, are reshaped to fit a de facto power-sharing deal.

Morsi took the oath in the Constitutional Court building before judges who recently issued a ruling dissolving the Islamist-dominated parliament that was elected late last year. Morsi contested the legitimacy of that ruling and pledged to take the oath in parliament. He lost that battle, but not before reciting a symbolic oath the day before in a packed Tahrir Square, the Egyptian revolution’s center stage and battleground.

“I will work to guarantee the independence of these powers and authorities,” a solemn Morsi told the country’s top jurists during Saturday’s swearing-in, which the military leaders did not attend.

The ceremony was held just a few blocks from a military hospital where ousted president Hosni Mubarak is reportedly receiving medical care. The name of the man who led Egypt for nearly three decades was barely mentioned Saturday. The once ubiquitous portraits of the imposing statesman with jet-black hair and a stern glare have all but vanished from the capital he ruled until he was pushed out on Feb. 11, 2011.

In his speech at the university, Morsi paid homage to the country’s security forces. Tantawi, one of several senior Mubarak-era figures who sat in the front rows of the large, stately hall where Morsi spoke, clapped approvingly.

“The SCAF has kept its word and fulfilled its promise,” Morsi said of the council, adding that the armed forces had borne great “burdens.”

He strongly suggested, however, that he wants to see the armed forces return to their barracks as the generals relinquish authority over the executive branch.

“They will go back to their main duties of protecting our borders,” he said.

Morsi said Egypt would not seek to meddle in the affairs of other countries or attempt to export its revolution elsewhere in the region. But he expressed support for Palestinian unity and for Syrians battling an autocratic government.

Citizens’ hopes

Outside the university gates, Egyptians marveled at the relatively small footprint of the security convoy that had ferried Morsi to the event; Mubarak’s, they recalled, was enormous and shut down entire streets whenever the president zipped across town. Many onlookers carried Egyptian flags and said they hoped to catch a glimpse of Morsi. The atmosphere was generally festive, but in a reflection of the heavy expectations awaiting the new president, several spectators immediately ticked off their demands.

Hoda Tawfiq, 13, was literally carrying a list, one she had handwritten and hoped to pass to Morsi. It pleaded with him to clean the Nile River and create an organization for street children, “so that we can discover their talents.”

Hoda’s mother, Azza Mohammed, 45, said she expected Morsi to clean up squatter camps, improve education, provide consistent running water and help poor people such as her — an unemployed, divorced mother — open kiosks.

“We are optimistic,” Mohammed said.

Law students Arwa Abdullah, 25, and Nabil Abdul Hamid, 47, said they had voted for Morsi’s rival, former air force chief Ahmed Shafiq, because they are worried about security and, as Abdullah put it, “he would know what to do.” But they said they were willing to give Morsi a chance for one year.

Not all Egyptians held out hope. Mohammed Hamid, 27, an unemployed driver, said he harbored doubts about Morsi, in part because he expects him to “stir up the people” to end the Israeli occupation of Palestinian territories.

“His revolutionary style won’t work in the country. It will create problems, and we don’t need wars,” Hamid said. “He should focus on domestic politics. Everything is so expensive for the youth. There are prisoners. Elderly people. Street peddlers and vendors. He should look internally first.”

On a cafe-lined downtown street where people smoked water pipes at outdoor tables, most of the televisions were turned to the soccer match between Egypt and the Central African Republic, not the military ceremony. Ayman el-Far, 24, was seated in front of one of the few screens displaying the handover, but he said he considered the pomp and circumstance all for show.

“The military is not walking a straight line,” he said. “The constitutional amendment is proof.”

Nevertheless, he acknowledged the historic significance of the day.

“Two years ago, Morsi was a political prisoner and Mubarak was president,” he said. “Now Mubarak is a prisoner and Morsi is president.”

He said the backing of the Brotherhood had made Morsi the candidate most able to challenge the military’s grip on power.

“But we’ve been hearing things for 30 years and we haven’t seen anything,” he said. “We want to see implementation.”

Ingy Hassieb and Haitham Mohamed contributed to this report.