Changes to environment laws, which include stricter regulations on animal snares and impose tougher penalties on employers if their staff illegally poison birds, have been passed by MSPs.
But the changes in The Wildlife and Natural Environment (Scotland) Bill did not go far enough for some MSPs or campaigners, with a controversial amendment which sought a ban on snares voted down in favour of tougher regulation.
MSP Irene Oldfather, who tabled the amendment, argued that, even when snares are used legally, "animal suffering cannot be avoided".
She said: "Scotland should treat its beautiful wild animals with respect and accept once and for all that killing them in wire nooses is a technique which must be consigned to the dustbin of history."
Despite support from the SNP's Christine Grahame and Labour MSP Marilyn Livingston, among others, Ms Oldfather's amendment was voted down by 72 votes to 50.
Environment Minister Roseanna Cunningham said: "Crofters, gamekeepers and farmers all over Scotland need to be able to protect their crops and livestock."
She added that if the amendment was agreed they would have "no other option than lamping and shooting".
The Bill contains legislation which will impose tougher punishments on employers if their staff illegally poison birds of prey.
"Vicarious liability" would make landowners criminally responsible for the actions of their employees.
However, amendments which sought to make it impossible for a minister to issue a licence to kill protected raptors in order to protect game birds were defeated.
Labour MSP Peter Peacock said it was "a ridiculous idea" to allow protected species to be killed in order "to protect birds bred in huge numbers solely for the purpose of shooting them".
However, Ms Cunningham said an all-out restriction was "inflexible", and MSPs voted 78 to 45 against the amendment in favour of leaving the decision in the hands of ministers.
Ms Cunningham also successfully tabled an amendment which will require ministers to deliver an annual report on wildlife crime.
She also gave an assurance that the Government would launch a consultation on conferring more enforcement powers to animal protection groups such as the SSPCA to alleviate the burden on the police, in exchange for the withdrawal of an amendment by Mr Peacock that sought to confer such powers in the new act.
Moves by Labour to give ministers further powers to "name and shame" estates where protected birds are killed were also voted down.
The decision to vote down the ban on snares was condemned by animal rights charities the League Against Cruel Sports and The Scottish Wildlife Trust (SWT).
The League's Scottish spokeswoman Louise Robertson said: "The overwhelming will of the public has been ignored here today and animals will continue to suffer in their thousands as a result."
SWT head of policy Tony King said their use was "indiscriminate and therefore against European conservation law".
However, the continued use of snares was welcomed by the Game and Wildlife Conservation Trust (GWCT) and the British Association for Shooting and Conservation (BASC).
GWCT Scottish director Dr Adam Smith said the new legislation "will make the practice of snaring in the future for the control of pest species more effective and more humane".
BASC Scotland's Nicolle Upton said: "The Bill has been a useful vehicle which has given MSPs the opportunity to see land management activities such as snaring in practice and to be briefed in depth on how the countryside actually works."
The Bill was passed unanimously by MSPs at Holyrood this evening, and will now go forward for royal assent.