SNP and Green MSPs united to achieve a majority in favour of the First Minister’s motion to seek a section 30 order to give Holyrood permission to hold a poll between autumn 2018 and spring 2019.
Nicola Sturgeon’s referendum motion was passed by 69 votes against 59. SNP members applauded the result and Ms Sturgeon clapped her desk.
A Green amendment to the motion calling for 16 and 17 year-olds as well as EU citizens to be given a vote was passed by the same margin.
The votes of the SNP and Green MSPs narrowly defeated the Conservatives, Labour and the Lib Dems who voted against Ms Sturgeon’s motion.
MSPs voted at the conclusion of a two day debate, which had been interrupted by the attacks on Westminster last week.
Re-opening the debate Ms Sturgeon said: “The people of Scotland should have the right to choose between Brexit - possibly a very hard Brexit - or becoming an independent country, able to chart our own course and create a true partnership of equals across these islands.”
Ms Sturgeon said she hoped the UK Government would respect the will of the parliament and deliver a section 30 order.
But with Theresa May determined to block a referendum, Ms Sturgeon added that she would return to parliament after next week’s recess to set out the next steps she will take “to progress the will of the parliament”.
Scottish Tory leader Ruth Davidson said: “This isn’t the serious plan of a responsible government. It’s just the SNP cooking up the same old recipe for division.
“Take one unworkable proposal. Add in some Greens. Stir in grievance. And bring to the boil.
“It might have worked once – but let me tell the First Minister: it stinks and most people in Scotland aren’t buying it.
“Since the debate was postponed last Wednesday, we have learned - that fewer than half of nurseries in Scotland will offer extended free early learning and nursery hours. That Police Scotland has a projected deficit of nearly £50 million next year.
“That just five per cent of Scottish schools have been inspected in Scotland in the last year.
“That the SNP Government has u-turned on junior doctor hours and now won’t bring down the amount of time they can work.
“That two formers members of the independent panel into the Mesh implants scandal are warning that the report is a `betrayal’ and will be `watered down’. And, only this morning, we learn that cancer waiting times have been missed again, for the fourth year in a row...This is not the time to be side-tracked by yet more unnecessary division.
“It is time for a Government that focuses on the job we pay it to do.”
Scottish Labour leader Kezia Dugdale said: “Let’s not pretend that this SNP-Green push for another divisive referendum reflects the will of the Scottish people. Because it doesn’t.
“Eighty-five per cent of the population voted in the last referendum, and we voted decisively to remain in the UK. That’s the will of the people and it should be respected.
“My message to the First Minister remains unchanged: we are divided enough – do not divide us again.”
Scotland’s Brexit Minister Mike Russell said “it’s a question now of how, rather than if”.
He added: “The real issue now is no-one can stand against it. It’s the choice of the Scottish Parliament, it’s the choice of the Scottish people, and that will be recognised globally. So what we now need to do is have a sensible discussion about how this proceeds.
“Theresa May has succeeded in creating constitutional chaos throughout the UK. I hope there will come a moment, and perhaps this is that moment, in which she recognises this is a foolish way to operate.”