CAIRO —  Egypt’s new prime minister and his Cabinet were sworn in on Thursday, the first government since the election of a Muslim Brotherhood leader as the country’s first freely elected president.

Prime Minister Hesham Kandil pledged that his new 35-member Cabinet would be a “people’s government” and promised the public “Bread, freedom and social justice. The country’s youngest ever prime minister called on Egyptians to rally behind the Cabinet, promising it would represent all the people and trying to deflect the belief that it will be solely under the Brotherhood’s sway.

The U.S.-educated Kandil also confirmed that Hosni Mubarak’s defense minister of 20 years, Field Marshal Hussein Tantawi, had retained the post. Tantawi led the military generals who took over from Mubarak when the president stepped down nearly 18 months following a popular uprising. Tantawi’s ongoing role is a reflection of how the military, which he heads, still holds overwhelming powers in the country. The military had said weeks ago that it would decide who serves as defense minister.

The Cabinet seemed designed to avoid any appearance of Brotherhood domination, including several members of the out-going, military-picked government and mainly technocratic figures. Still, Brotherhood members took four ministries, including the key information minister post, which oversees state media.

The new government is the first since the June 30 inauguration of President Mohammed Morsi, a longtime Muslim Brotherhood leader. It comes at a time when tensions are mounting over the country’s tenuous security, recent sectarian violence and growing popular discontent over issues such as widespread power and water outages as well as shortages.

In a sign of the chaos, one person was shot to death by police Thursday when a crowd of hundreds went on a rampage against a luxury hotel on the Nile River in central Cairo. The crowd threw firebombs at the hotel, smashed its lobby and set fire to 10 cars, a security official said, speaking on condition of anonymity because he was not authorized to talk the press.

Security forces fired tear gas on the crowd and opened fire, killng one person, the official said.

The crowd came from a slum located just behind the hotel, which is a twin-tower skyscraper complex that includes a glitzy shopping center and offices. Earlier in the day, several residents of the slum who had been hired by the hotel for protection had tried to get into the hotel to collect payments owed to them. Police stopped them, an altercation ensued, and a policeman shot and wounded one of the men. The larger crowd of nearly 500 returned later and attacked the hotel, the security official said.

Earlier this week, sectarian violence in the village of Dahshour south of Cairo saw a Muslim mob torching Christian homes and damaging the local church, which forced many Christian families to flee the village Wednesday. The attack was sparked when an earlier personal dispute swelled into violence and a Muslim man died.

At a press conference before the swearing in, Kandil noted the country’s “grave challenges.”

“We are all Egyptians in the Arab Republic of Egypt. The coming period is not easy, to say the least, and we are all in the same boat,” he said. “This is the people’s government, it does not belong to this or that trend.”

The line-up of the 35-member Cabinet falls far short of the unity government that Morsi had initially said he would put together, bringing together political factions. Instead, the members were largely technocrats. And many will be looking to see how many of the new ministers, while not Brotherhood members, are Islamists or sympathetic to the movement to gain a real picture of the government’s diversity.

Morsi’s choice of Kandil, a devout Muslim reported by some Egyptian media to be sympathetic to the Brotherhood, has angered the liberals and leftists who launched the uprising against Mubarak. In his 40s, he maintains that he has no formal links to any of the country’s Islamist political parties.

The finance and foreign ministers from the outgoing, military-picked government were retained, an apparent attempt to show there will not be destabilizing changes in those fields.

Outgoing prime minister Kamal el-Ganzouri became the first member of Morsi’s own presidential team when the president named him on Thursday as an adviser, according to state TV. El-Ganzouri, in his late 70s, also served as prime minister under Mubarak.

The Cabinet lineup includes only two women — one of them also a Christian — and signaled Morsi’s failure to give women and minority Christians more than the token representation they had under Mubarak’s 29-year authoritarian rule.

It also does not include any of the iconic youth figures of the 18-day, anti-Mubarak uprising. Still, Kandil sought to gain the goodwill of the secular, pro-reform groups behind the revolt, saying his government wanted to realize its slogan: “Bread, freedom and social justice.” He acknowledged that he was abroad when the uprising began Jan. 25, 2011.

The radical Islamist Al-Nour party, which supported Morsi in his presidential bid, decided to boycott the government after it was only offered the environment portfolio. It had wanted the communication, local development and business sector ministries, according to a party spokesman.

Brotherhood members were given the key ministry posts of information, higher education and housing. A fourth Brotherhood member was named minister of state for youth. The information portfolio gives the Brotherhood control over state television, long criticized by Islamists to be lax in safeguarding against Western cultural influence.

The higher education portfolio gives the Brotherhood control over the country’s universities, a traditional recruitment ground for the fundamentalist group. The Youth portfolio could give it an even wider area for recruitment and religious indoctrination.

The military generals who took over from Mubarak in February 2011 handed over power to Morsi but not before they stripped the new president of significant powers and declared themselves as the country’s legislative authority after dissolving the Brotherhood-dominated parliament. The military also has control over the process of drafting Egypt’s new constitution.

The new government comes to office during one of the worst bouts of unrest since the days and weeks that immediately followed Mubarak’s Feb. 11, 2011 ouster.

Lengthy power and water outages in Cairo and across the nation of some 82 million people have been sending thousands to the streets to protest daily. In many cases, protesters cut off roads or attacked government offices.

The outages have deepened the suffering of Egypt’s mainly Muslim population, coinciding with the dawn-to-dusk fasting during the Muslim holy month of Ramadan, which this year falls during the scorching July and August heat. During Ramadan, devout Muslims refrain from eating, drinking, smoking and other worldly pleasures.

The popular discontent has spread to the gates of Morsi’s presidential palace in Cairo’s leafy suburb of Heliopolis where hundreds gather every day to express a wide range of grievances or to demand jobs, better medical care or housing. Morsi opened two offices to receive citizens’ complaints.

The offices attracted thousands who hoped the new president will redress perceived injustices or meet their demands. Butt hope was soon replaced by despair when nothing was done and some applicants returned to protest.

Egypt’s economy is also sliding fast, with more than half of foreign currency reserves wiped out in the last 18 months, and tourism, a mainstay of the economy, wildly fluctuating to reflect unrest in the country.