A car containing Prince Charles and his wife, Camilla, was attacked last night as a wave of protest swept through central London in the wake of a Commons vote to force through a trebling of university tuition fees for students in England.

Protesters cracked windows and threw paint on the Rolls-Royce after it became separated from its police escort and was surrounded by demonstrators who had spilled into the West End after an initially peaceful demonstration outside parliament rapidly deteriorated and spread.

One, Ben Kelsey, said: "There were 400 to 500 protesters there. It was fairly obvious who was in the car. It was very well lit up. Charles and Camilla looked quite relaxed at first but when they saw how many people there were they began to get worried. A few seconds later the area was packed with police. It was complete chaos."

Another witness described how a police protection officer, dressed in a tuxedo, travelling in convoy with the royal couple opened the doors of his car to beat his way through the crowds.

The royal couple had looked visibly shaken when they arrived at the London Palladium for the Royal Variety performance, but Camilla later joked about the incident, saying: "First time for everything" as she left the theatre.

A Clarence House spokeswoman said: "We can confirm that their royal highnesses' car was attacked by the protesters on the way to their engagement at the London Palladium this evening. Both their royal highnesses were unharmed."

The attack is likely to heighten the pressure on the Met commissioner, Sir Paul Stephenson, whose tactics in the previous demonstrations have been heavily criticised. Stephenson admitted being caught by surprise by the scale of the first protest last month, when demonstrators raided Millbank Tower. At a later protest the police presence was much stronger, leading to complaints about heavyhanded kettling.

Stephenson last night said that it had been a "very long" and "very disappointing day for London". He added: "We did everything we could to facilitate peaceful protest and, in reality, while I'm sure the vast majority came here to want to protest peacefully, a significant number of people behaved very badly today." He said the force will launch a full investigation.

The prime minister, David Cameron, condemned the violence as "unacceptable". "It is shocking and regrettable that the car carrying the Prince of Wales and the Duchess of Cornwall was caught up and attacked in the violence."

Home secretary Theresa May said: "I utterly condemn the increasing levels of violence and disorder that some of the protesters have been, and still are, involved in. What we are seeing in London tonight, the wanton vandalism, smashing of windows, has nothing to do with peaceful protest."

The protests followed the vote over tuition fees in the Commons when 21 Liberal Democrat MPs voted against the plans and five abstained, refusing to follow their leader, Nick Clegg, and other Lib Dem ministers in favour of a new upper limit for fees of £9,000 from 2012, the culmination of an agonising few weeks for the junior party in the coalition.

As news of the vote came through, the demonstration became more heated with fires lit in Parliament Square, rocks thrown at the police, attempts to smash into the Treasury and the supreme court and a surge into the National Gallery's impressionist rooms.

In freezing temperatures, an attempt to burn down the Christmas tree in Trafalgar Square was thwarted, and some Christmas shoppers had to flee the trashing of shop windows on Oxford Street. The violence, at the end of the third in a series of demonstrations against the fee rise, was condemned by the National Union of Students.

The police again penned in demonstrators saying they were dealing with a crime scene. At least eight police officers were injured including one seriously.

The Commons vote came at the end of a serious five-hour debate in which the shadow business secretary, John Denham, warned: "If this Tory measure goes through with the support or abstention of Liberal Democrats, that party will forfeit the right to call itself a progressive political party."

The Lib Dems signed an NUS pledge before the election vowing not to vote for an increase in tuition fees. But the business secretary, Vince Cable, said he was proud of the government's package, and that his party would reunite.

In the wake of the vote, Clegg rushed out a message to party members urging them to reunite: "Of course I understand why many in our party wish we could have pursued a different policy. I wish that too, but we simply were not in that position, we did not win the general election but went into a coalition and had to tackle the greatest economic crisis in decades."

"This is a package which is fairer than the existing situation, fairer than Lord Browne's original review, fairer than the NUS proposals and fairer than the policies that both Labour and the Conservatives would have implemented had they been in government alone."

Although the fees increase will now be voted on in the Lords on Tuesday, there is little or no expectation that the coalition will suffer a defeat, ensuring that the biggest change to university funding for a century will be introduced in 2012.

Cable admitted after the vote that the government hadd failed to get across its central message that the reforms would ensure greater fairness. "We have now to get the message out that we had to put universities on a sound financial footing and we are having to deal with this horrendous problem of the government deficit that we inherited."

"We had to make painful choices affecting universities and other things. But we have done it in a way that makes the system fairer," he said.

We have to explain that so that the next generation feel confident in applying for universities which will be in their long term interests. There is a big job to be done and I will very much be in the thick of that."

Lib Dem cabinet ministers admitted that the party had been damaged over the past week amid confusion over how ministers would vote.

Two Liberal Democrat parliamentary private secretaries, Jenny Willott and Mike Crockart, and one Tory, Lee Scott, resigned in protest.For most of the day the protests in London, attended by several thousand – one protest group claimed as many as 30,000 –demonstrators, were tense but peaceful. Thousands were kettled within Parliament Square for several hours and unable to leave.

Hundreds of riot police stood shoulder to shoulder outside parliament and at the exits to the square, where a small number of protesters clashed with heavily armoured officers and police horses, leading to nine arrests.Police blamed "a continued unprovoked attack by protesters" for the violence and containment, but many demonstrators complained of excessive force, including baton charges on foot and horseback.

At least 38 protesters were injured, according to the Met. There were 26 arrests.