Italian PM Silvio Berlusconi has narrowly won a vote of confidence in the lower house of parliament by 314 to 311, prompting street protests.
In Rome, violent clashes have left 50 police officers and at least 40 protesters injured.
The marchers set fire to cars, threw stones and overturned bins in Italy's worst street violence in recent years.
Mr Berlusconi's critics say he is too deeply mired in scandal and corruption allegations to remain in office.
The Italian prime minister, 74, is halfway through a five-year term but his position has been weakened by a series of scandals, largely involving his relationships with women.
He has also lost the support of his closest political ally, Gianfranco Fini, along with dozens of his supporters, depriving him of his automatic majority in the lower house.
Opposition remains
Thousands of people gathered in Rome and Italy's other major cities to demand a change in government.
Police fired tear gas on the protesters in Rome and several explosions - thought to be fireworks - were heard. Demonstrators threw eggs, paint and stones at parliament buildings.
Inside, two opposition deputies switched sides for the final vote, giving Mr Berlusconi a narrow victory.
In the historic centre of Rome, teeming both with Christmas shoppers and with student protesters, there were at first scenes of jubilation, quickly followed by shouts of anger that the media mogul had once again confounded his critics and pulled off another apparent victory.
One prominent commercial TV channel news anchorman (who does not work for Mr Berlusconi) initially got the result wrong, causing temporary confusion.
The centre of Rome had been cut off all day from the rest of the Italian capital by hundred of armed police.
They blocked the narrow streets with their vehicles to try to prevent student protesters from disrupting the vote.
In the Via del Corso, Rome's High Street, police charged one group of demonstrators who had set light to a rubbish lorry and tables and chairs snatched from nearby bars.
In the distance, clouds of black smoke rose into the bright blue winter sky as other protesters set cars on fire near the Piazza del Popolo.
The smell of tear gas continued to hang heavy in the air around parliament.
Scuffles broke out in the lower house after opposition MP Katia Polidori voted in favour of Mr Berlusconi, and voting was briefly suspended.
Speaking in parliament, former anti-corruption judge Antonio Di Pietro - who now leads the opposition Italy of Values party - told Mr Berlusconi he was finished.
"Whatever the result of the vote you have bought, one thing is clear. You do not have a political majority that would allow you to govern," he said.
"Whether you like it or not, you have reached the end of the line for your political experience."
Last week, Mr Pietro made a formal complaint alleging that Mr Berlusconi was trying to buy votes. Rome magistrates have now begun an investigation.
There were also protests elsewhere.
In the Sicilian regional capital, Palermo, 500 students occupied the main airport runway.
In Turin in the north, students occupied the railway station, while in Venice they held a demonstration on the famous Rialto Bridge.
The demonstrations follow weeks of bitter protests against the government, which has announced austerity measures, including cuts in education spending.
The BBC's Duncan Kennedy in Rome says although Mr Berlusconi's lobbying has paid off for now, he will still face considerable opposition to his leadership.
Mr Berlusconi has become notorious for his gaffes. At a dinner with his MPs the night before the vote, the newspaper Corriere della Sera quoted him as saying: "I am unable to say 'No', I have never been able to, I've been lucky that no gay person has ever come to proposition me."
Source