CAIRO — Egyptian police fired tear gas and rubber bullets and beat protesters to clear thousands of people from a central Cairo square today after the biggest demonstrations in years against President Hosni Mubarak's authoritarian rule.

Two protesters and a police officer were killed in the nationwide demonstrations inspired by Tunisia's uprising, which also demanded a solution to Egypt's grinding poverty and were likely to fuel growing dissent in a presidential election year.

Mobilized largely on the Internet, the waves of protesters filled Cairo's central Tahrir — or Liberation — Square on Tuesday, some hurling rocks and climbing atop armored police trucks.

"Down with Hosni Mubarak, down with the tyrant," chanted the crowds. "We don't want you!" they screamed as thousands of riot police deployed in a massive security operation that failed to quell the protests.

As night fell, thousands of demonstrators stood their ground for what they vowed would be an all-night sit-in in Tahrir Square just steps away from parliament and other government buildings — blocking the streets and setting the stage for even more dramatic confrontations.

A large security force moved in around 1 a.m. today, arresting people, chasing others into side streets and filling the square with clouds of tear gas. Protesters collapsed on the ground with breathing problems amid the heavy volleys of tear gas.

The sound of what appeared to be automatic weapons fire could be heard as riot police and plainclothes officers chased several hundred protesters who scrambled onto the main road along the Nile in downtown Cairo. Some 20 officers were seen brutally beating one protester with truncheons.

"It got broken up ugly with everything, shooting, water cannon and (police) running with the sticks," said Gigi Ibrahim, who was among the last protesters to leave the square. "It was a field of tear gas. The square emptied out so fast."

Ibrahim said she was hit in her back with something that felt like a rock. "Some people were hit in their faces."

Some protesters turned violent amid the crackdown. They knocked down an empty white police booth and dragged it for several yards before setting it on fire, chanting that they want to oust the regime. A police pickup truck was overturned and set ablaze behind the famed Egyptian Museum. Protesters also set fire to a metal barricade and blocked traffic on a major bridge over the Nile.

Police at the bridge fired tear gas and protesters mounted a charge, forcing officers to retreat, though they quickly regrouped. Two protesters with bleeding head wounds were carried off in ambulances.

Well after midnight, the smell of tear gas drifted throughout central Cairo and riot police remained deployed in large numbers. Tahrir Square looked like a battlefield covered with rocks and debris. The gates of the ruling party headquarters near the square were smashed.

Scattered groups of protesters were holding out in several areas. Many were chased by police vehicles into the Shubra neighborhood, where the streets were strewn with rocks in a sign of a heavy confrontation.

Discontent with life in Egypt's authoritarian police state has simmered under the surface for years. However, it is Tunisia's popular uprising, which forced that nation's autocratic ruler from power, that appears to have pushed young Egyptians into the streets, many 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 Ismail Syed, a hotel worker who struggles to live on a salary of $50 a month.

"We want to see change, just like in Tunisia," said 24-year-old Lamia Rayan.

Dubbed a "day of revolution against torture, poverty, corruption and unemployment," Tuesday's protests in cities across Egypt began peacefully, with police at first showing unusual restraint in what appeared to be a calculated strategy 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 resonating in the region, it was an acknowledgment of the need to tread softly by an Egyptian government that normally responds with swift retribution to any dissent.

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.

At one point, demonstrators attacked a water cannon truck, opening the driver's door and forcing the man out of the vehicle. As protesters hurled rocks and dragged metal barricades, officers beat them back with batons.

Protesters emerged stumbling amid clouds of acrid tear gas, coughing and covering their faces with scarves. Some had blood streaming down their faces. One man fainted. Police dragged some away and clubbed a journalist, smashing her glasses and seizing her camera.

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

Like the Tunisian protests, the calls to rally in Egypt went out on Facebook and Twitter, with 90,000 people voicing their support. Throughout the day organizers used Twitter to give minute-by-minute instructions about where to gather in an attempt to outmaneuver the police, until the government blocked it in the late afternoon.

Twitter announced that its service had been blocked in Egypt at about 9 a.m. MST, and said that Twitter and its applications had been affected.

After remaining silent throughout the day, Egypt's government called Tuesday night for an end to the protests. The Interior Ministry, which controls the security forces, said authorities wanted to let the protesters 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. The ruling party said some 30,000 protesters had turned out across the country.

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