CAIRO (AP) -- Thousands of anti-government protesters, some hurling rocks and climbing atop an armored police truck, clashed with riot police Tuesday in the center of Cairo in a Tunisia-inspired demonstration to demand the end of Hosni Mubarak's nearly 30 years in power. Three people were killed in confrontations around the country.

After a day of violence, thousands of demonstrators stood their ground in downtown Cairo's vast Tahrir Square, steps away from parliament and other government buildings. They promised to camp out overnight, setting the stage for an even more dramatic confrontation.

Throughout the day, police blasted crowds with water cannons and set upon them with batons and acrid clouds of tear gas in an attempt to clear demonstrators crying out "Down with Mubarak" and demanding an end to Egypt's grinding poverty, corruption, unemployment and police abuses.

Tuesday's demonstration, the largest Egypt has seen for years, began peacefully, with police showing unusual restraint in what appeared to be a calculated strategy by the government to avoid further sullying the image of a security apparatus widely criticized as corrupt and violent.

With discontent growing over economic woes, and the toppling of Tunisia's president still resonating in the region, Egypt's government - which normally responds with swift retribution to any dissent - needed to tread carefully.

But as crowds filled Tahrir Square - waving Egyptian and Tunisian flags and adopting the same protest chants that rang out in the streets of Tunis - security personnel changed tactics and the protest turned violent. Around 10,000 protesters packed the square, the Interior Ministry said.

The sight of officers beating demonstrators had particular resonance because Tuesday was also a national holiday honoring the much-feared police.

A policeman was hit in the head with a rock during the protest in Cairo and died later in the hospital, an Interior Ministry official said.

In another demonstration in the city of Suez, two protesters were killed, he said. One of them had respiratory problems and died as a result of tear gas inhalation; the other was killed by a rock.

The official spoke on condition of anonymity because he was not authorized to release information to journalists.

In Egypt, discontent with life in the autocratic, police state has simmered under the surface for years. It is the example of Tunisia, though, that appeared to be enough to push many young Egyptians into the streets for the first time.

"This is the first time I am protesting, but we have been a cowardly nation. We have to finally say no," said 24-year-old Ismail Syed, a hotel worker who struggles to live on a salary of $50 a month.

Demonstrators attacked a water cannon truck, opening the driver's door and ordering the man out of the vehicle. Some hurled rocks and dragged metal barricades. Officers beat back protesters with batons as they tried to break cordons to join the main group of demonstrators downtown.

Protesters emerged stumbling from white clouds of tear gas, coughing and covering their faces with scarves.

Some had blood streaming down their faces. One man fainted. Police dragged some away and beat a journalist, smashing her glasses and seizing her camera.

Crowds also marched to the headquarters of Mubarak's National Democratic Party, shouting, "Here are the thieves."

After remaining silent throughout the day, Egypt's government on Tuesday night called for an end to the protests. The Interior Ministry, which controls the security forces, said authorities wanted to allow the protesters the chance to express their opinions and accused the crowds of "insisting on provocation."

"Some threw rocks at police ... and others carried out acts of rioting and damage to state institutions," it said.

In Washington, Secretary of State Hillary Rodham Clinton said Egypt's government, a key U.S. ally in the Middle East, is stable despite the outpouring. Clinton said Egyptians have the right to protest, but urged all parties to avoid violence.

At one point Tuesday, the protesters seemed to gain the upper hand, forcing a line of riot police to flee under a barrage of rocks. One demonstrator climbed into a fire engine and drove it away.

"I want my 3-year-old child to grow up with dignity and to find a job just like the president," said 50-year-old Eid Attallah, who works as a driver.

He said he had heard about the planned protests from friends but didn't expect them to be so big.

Many expressed similar surprise.

"We are fed up; this is just enough," said Sayid Abdelfatah, a 38-year-old civil servant who marched with an Egyptian flag. "Tunisia's revolution inspired me but I really never thought we would find such people ready to do the same here."

During a lull in the clashes, lines of protesters bowed in unison to perform the sunset prayer as police stood aside.

Demonstration organizers issued demands for Mubarak and his government to resign, for parliament to be dissolved and for a national unity government to be formed.

To the north, in the Mediterranean port city of Alexandria, thousands of protesters also marched in what was dubbed a "Day of Rage" against Mubarak and lack of political freedoms under his rule.

Like the Tunisian protests, the calls for the rallies in Egypt went out on Facebook and Twitter, with 90,000 people logging their support on the site. Organizers used the site to give minute-by-minute instructions on where demonstrators should go in an attempt to outmaneuver the police.

By late afternoon, access to Twitter appeared to have been blocked.

In another parallel with Tunisia, the protests drew energy in large part from the death of one person: a young Egyptian man named Khaled Said whose family and witnesses say was beaten to death by a pair of policemen in Alexandria last year.

His case has become a rallying point for Egypt's opposition. Two policemen are on trial in connection with his death.

Tunisia's protests were also sparked by the death of one man: a poor Tunisian vegetable vendor who set himself in fire to protest corruption.

Last week, several people in Egypt - and elsewhere in the Middle East and North Africa - set themselves on fire in apparent attempts to copy his actions.

Mothers carrying babies also marched Tuesday and chanted, "Revolution until Victory!" while young waved signs reading "OUT!" that were inspired by the Tunisian protestations of "DEGAGE!" Men sprayed graffiti reading "Down with Hosni Mubarak."

"We want to see change just like in Tunisia," said Lamia Rayan, 24, one of the protesters.

Some passers-by dismissed the protests, saying a few thousand of Cairo's 18 million people coming out on the streets was not nearly enough to force change.

"This is all just a waste of time," said Ali Mustafa Ibrahim, who works at a cigarette stand. "These are a bunch of kids playing cat and mouse. ... It's just going to create more problems and more traffic in the city."

Nearly half of Egypt's 80 million people live under or just above the poverty line set by the United Nations at $2 a day. Poor quality education, health care and high unemployment have left large numbers of Egyptians deprived of basic needs.

Hadeel Al-Shalchi, Hamza Hendawi and Tarek el-Tablawy in Cairo and Bradley Klapper in Washington contributed to this report.