Students will no longer have to pay the graduate endowment fee when they finish university, after MSPs voted to abolish the charge.
Holyrood voted by 67 to 61 in favour of scrapping the one-off charge of £2,289.
The vote means current students and those who graduated last year will not have to pay the fee.
Labour and the Conservatives voted against abolition, after they failed to force the Scottish Government to set up a review into university funding.
Amendments calling for an independent commission were defeated by 63 votes to 65.
Students had gathered outside the Scottish Parliament earlier on Thursday, calling on MSPs to back the plans.
The bill was supported by the SNP, the Liberal Democrats, the Greens, Margo MacDonald and one Labour MSP, Elaine Smith.
All the other Labour MSPs and the Conservatives argued that the £17m cost could be better spent.
Approximately 50,000 students will benefit from the abolition.
The endowment fee was introduced in 2001, after the abolition of upfront tuition fees.
But about 70% of graduates have simply added it on to their student loan, as they do not have the funds to pay it.
After the bill was passed, Education Secretary Fiona Hyslop said: "We believe access to education should be based on ability to learn, not ability to pay.
"Today's removal of the graduate endowment fee is great news for current and future students and last year's graduates, helping to significantly reduce their debt burden."
The education secretary described the abolition of the fee as a "down payment" on plans to tackle student debt.
The SNP had pledged to ditch student debt in its election manifesto and Ms Hyslop added: "We believe that debt, and the fear of debt, can be a real deterrent and can actually prevent some young people going to university."
She described scrapping the fee as the "first stage of our plans".
Ms Hyslop also claimed that taxpayers would benefit from the abolition, as well as students.
She said: "The graduate endowment fee was an inefficient tax.
"Most students increased their student loan to pay it and, due to the inefficiency of the system, only two-thirds of this income was then returned to the public purse."
But Labour education spokeswoman Rhona Brankin claimed ministers had "failed miserably" to produce persuasive evidence that scrapping the charge would increase the numbers going to university.
She also said abolishing the endowment would not tackle student poverty, arguing that the government should instead be doing more to support students from poorer backgrounds during their studies.
The Conservative deputy leader, Murdo Fraser, backed Ms Brankin's call for an independent review.