CAIRO - Egyptian President Hosni Mubarak ordered his Cabinet ministers to resign early Saturday but also vowed to remain in power himself and backed his government's use of force to quell the massive protests that have challenged his 30-year rule.

Speaking on state television shortly after midnight, minutes before he spoke by telephone with President Obama, Mubarak lamented rioting and clashes with police Friday that led him to deploy military units on the streets of the capital.

"I take responsibility for the security of this country and the citizens," he said, adding that he would not allow fear and chaos to take hold in this nation of more than 80 million people.

He said he would give the new government "very specific goals" to improve the lives of the people.

About an hour later in Washington, Obama said he had just spoken to Mubarak and told him that "he has a responsibility to give meaning to those words" and deliver on his promise to address people's grievances.

"I want to be very clear in calling on the Egyptian authorities to refrain from any violence against peaceful protesters," Obama said at the White House. "The people of Egypt have rights that are universal," including the right to assembly and free speech. "These are human rights, and the United States will stand up for them everywhere."

Obama also said demonstrators "have a responsibility to express themselves peacefully."

Mubarak spoke after military units deployed in the streets of Cairo and protesters attacked offices of the government and ruling party, with crowds of opposition demonstrators defying an overnight curfew.

In some parts of the capital, the protests appeared to grow more violent, and demonstrators looted and burned the headquarters of the ruling National Democratic Party, attempted to storm government buildings and attacked a police station. But in other parts, an apparently festive atmosphere prevailed, as demonstrators warmly greeted newly deployed army troops and urged them to join the protests. Unlike the police, the military did not appear to be battling the demonstrators.

By late night on Friday, police had largely abandoned the streets of the capital to the remaining bands of protesters.

By blaming the cabinet under Prime Minister Ahmed Nazif for the turmoil, Mubarak, 82, hoped to sidestep demands for his resignation after three decades of autocratic rule. He said he had asked the government to give the demonstrators the "space" they needed to voice their grievances and was "so sorry" to see protesters and police injured in clashes.

"There is a very thin line between freedom and chaos," he declared. "I am absolutely on the side of freedom for each citizen, and at the same time I am on the side of the security of Egypt. And I would not let anything dangerous happen that would threaten peace . . . and the future of the country."