Premier Silvio Berlusconi won back-to-back confidence votes Tuesday in the Italian parliament, narrowly surviving one of the toughest fights of his political life. But violent protests greeted his victory, as rioters torched cars, smashed windows and clashed with police.

Riot police fired tear gas to try to disperse the crowds in Rome after earlier trying to cordon off the area around parliament. Clouds of white tear gas and orange flares engulfed some streets, shops full of Christmas goods hurriedly closed down and employees at one bank cowered in fear as waves of stone-throwing youths swept by.

Tensions inside parliament's lower house had boiled over earlier in the day, as lawmakers pushed and shoved each other, forcing a brief suspension in the voting.

Ultimately, Berlusconi survived the lower house's no-confidence motion by just three votes after a more comfortable victory in the Senate earlier in the day.

The outcome of the highly uncertain votes attested to Berlusconi's uncanny ability to survive, even when nearly all indications pointed to a government collapse. Yet it also indicated he will have a difficult time governing given the narrow margin.

Berlusconi had been weakened after a year dominated by sex scandals, corruption charges against some of his aides and a breakup with a close political ally.

But the 74-year-old battled back, swaying a few crucial lawmakers to vote in his favor and pressing a successful case that stability in Italy trumped political infighting at a time of economic crisis. Italy has high public debt level and slow growth, and the financial markets have been concerned that it could be dragged into Europe's debt mire.

The outcome marked a victory for Berlusconi over the one-time ally who has become his most bitter rival, Gianfranco Fini, and dealt a blow to Fini's ambitions to replace Berlusconi as conservative leader.

Ironically, it was Fini in his capacity as speaker of the lower house who announced the result: 314-311 in favor of the government. Applause broke out and Fini quickly ended the session.

Pierluigi Bersani, leader of the opposition Democratic Party, called the result a "Pyrrhic victory."

Tuesday's victory was obtained thanks to the votes of a handful of swing lawmakers, including some close to Fini, who changed their minds at the last minute.

Fini acknowledged defeat, saying the outcome was made more painful by the defections of three of his lawmakers. He said future weeks would show if Berlusconi would be able to turn his "numerical victory" into political capital. Some called for Fini's resignation as house speaker.

The down-to-the-wire vote capped hours of tension inside and outside parliament.

Three pregnant women whose presence had been in doubt showed up and were among the first to cast their votes, all against Berlusconi, to the applause of their allies. One arrived by ambulance, another in a wheelchair. As undecided lawmakers were called to cast their vote, some in the house cheered them on, while others jeered.

Scuffles that forced a brief suspension of voting broke out as one of Fini's defectors announced her vote in favor of Berlusconi.

Minutes after the results were announced, talks began among Berlusconi's allies over how to broaden the government's majority, possibly to include the swing lawmakers or small parliamentary groups.

Outside parliament, hundreds of students, some of them downing beers as they marched, smashed shop windows, destroyed bank ATMs and set at least three vehicles on fire. They even entered a bank, prompting staffers to try to barricade themselves inside.

Police fired tear gas as the protesters neared Berlusconi's residence.

Along the central Via del Corso, charred cafe seats and overturned cobblestones littered the streets as protesters moved away from parliament. A hundred moved to a nearby piazza, forcing Christmas-decked stores to close as panicked shopkeepers watched in fear.

At the central Piazza del Popolo, firefighters worked to douse the handful of cars set on fire, while protesters rained stones down on anyone passing by from a terraced park on the hill above.

Protests also took place elsewhere in Italy. In Palermo, students blocked the train station and occupied the airport, while in Turin thousands marched through the city center, news reports said.