Tony Blair has scraped home by just five votes in a crunch House of Commons test of his controversial plans to introduce university top-up fees.
Blair now faces the test of the Hutton report
The Higher Education Bill was backed by 316 votes to 311 after days of intense campaigning by ministers and rebels.
Mr Blair had staked his authority on winning the vote, which was widely seen as his biggest test as prime minister.
It provides a boost hours before Lord Hutton's verdict on the death of Iraq weapons expert Dr David Kelly.
The close vote saw a major reduction in the government's usual majority of 161 in the tightest victory of Mr Blair's premiership.
It means the bill has passed its first major hurdle but the plans will still be put to the test in further votes in the Commons and Lords as it goes through the parliamentary process.
MPs are now likely to spend two to three months going through the bill line-by-line in its committee stage.
Education Secretary Charles Clarke told BBC News: "Had we lost it, it would have been a blow to our authority but as it is we have the ability to take the legislation forward."
The minister said divisions always caused "a bit of damage" but were not surprising over such serious reforms.
Both the Conservatives and Liberal Democrats opposed the plans, which would allow universities to charge students £3,000-a-year, payable when they earn £15,000.
Shadow education and health secretary Tim Yeo branded the result an "utter
humiliation" for ministers.
The government had only won because Scottish Labour MPs voted to impose fees on English students which would not apply north of the border," he said.
Liberal Democrat leader Charles Kennedy said the vote would prove very damaging for Mr Blair.
"Nobody has emerged from this shabby compromise with any credit," he said.
"It took a
dodgy deal between the prime minister, the chancellor and backbenchers to get
this Bill through," he said.
Tory whips say two of their MPs abstained, one of them because he held a Scottish seat, while one Conservative backed the government.
If all Tories had opposed the plans, the government majority would have been cut to just one.
The vote was hailed as a "landmark" by the vice-chancellors' representatives, Universities UK.
But Mandy Telford, president of the National Union of Students, said told BBC News 24: "It's only the second reading. For us the fight is far from over."
Government hopes had been lifted when chief rebel Nick Brown's decided to switch sides late on Tuesday morning.
The ex-minister said agreement to produce a report next year on the fees' impact on middle income homes and the promise of extra money led to his switch.
BBC political correspondent Shaun Ley said a deal with Mr Brown was brokered by Chancellor Gordon Brown - of whom Nick Brown is a close ally - together with the Deputy Prime Minister John Prescott.
But Downing Street said there had been no last minute concessions.
Leading rebel Ian Gibson there was a clear message for the prime minister.
"It's an unpopular policy and you need to change some of the elements of it to make it popular," he said.
Before the vote, Mr Prescott told BBC News 24 there were many lessons to be learnt.
"I don't think it's been handled very well - a 160-odd majority and scrambling around to get a few to come into the vote," he said.
Opening the six-and-a-half hour debate on the plans, Mr Clarke told MPs the new fees regime would provide £1bn a year for universities.
If the bill was defeated, he had argued that "universities will be stripped of the resources they need to address the challenges of the future".
But former Labour minister Kate Hoey questioned how anyone could trust the government to keep this pledge when "we haven't actually kept the manifesto commitment" not to introduce the fees.