Ministers have hinted that they may still allow the tails of working dogs to be docked.
Campaigners say docking can stop injuries to dogs
A majority of MSPs have voted for a blanket ban but were told that an exemption could be introduced for working dogs after consultation.
The ban has been included in the Animal Health and Welfare (Scotland) Bill, which also includes increased slaughter powers to combat disease.
However, such a move would have to be preceded by a statement to MSPs.
Those in favour of docking have argued that it prevents the tails of working dogs being caught in hedges and briars, injuring the animals.
MSPs including Deputy Environment Minister Rhona Brankin remain opposed to the practice, however she said exemptions could still be included in the relevant section of the bill and these would be brought before parliament.
She said: "Section 18 will not be enacted until the regulations allowing exemptions have been drafted, consulted on and approved by parliament.
"This means that no final decision will be taken on the tail docking of dogs until the regulations are completed."
A majority of MSPs also backed an amendment in Environment Minister Ross Finnie's name, forbidding anyone from taking a dog out of Scotland to have the procedure carried out.
Conservative MSP Ted Brocklebank criticised ministers for not backing exemptions.
He said: "It beggars belief that owners of working dogs would expose them to unnecessary suffering.
Opposition MSPs raised concerns about slaughter proposals
"Why do politicians in this place arrogantly assume that they know better than the owners of these working dogs?"
Liberal Democrat MSP Andrew Arbuckle backed consultation on the issue.
SNP and Tory amendments which would have required ministers to take expert advice from scientists and vets before ordering the slaughter of livestock in times of disease were narrowly defeated.
However, an amendment from Labour backbencher Maureen Macmillan, obliging ministers to outline their plans to Holyrood, was supported.
She said: "Ultimately it's the minister's responsibility to take difficult decisions, including whether to slaughter animals or birds beyond immediate disease risk zones.
"My amendment will require, before exercising additional slaughter powers, to set out in a statement the circumstances giving rise to the decision and why additional slaughter powers are to be used."
Scottish Green MSP Mark Ruskell expressed concern at the "seemingly limitless powers" in the legislation, with protocols and contingency measures in England and Wales affording more protection there.