The Scottish Parliament has voted to support an outright ban on fracking after SNP MSPs abstained.
Labour tabled an amendment saying there "should" be a full ban as part of an environment debate headed by new cabinet secretary Roseanna Cunningham.
After SNP members abstained, the motion was passed by 32 votes to 29.
Energy Minister Paul Wheelhouse said there needed to be proper research and a public consultation before a decision was taken on fracking.
Scottish Labour said it would be "outrageous" if the SNP "ignored" the result of the vote.
The amendment is not a binding policy, but represents a defeat for the SNP, which supports a moratorium on fracking but stops short of backing a full ban.
The SNP's manifesto for the Holyrood election committed to there being no fracking in Scotland "unless it can be proven beyond doubt that there is no risk to health, communities or the environment".
Labour, the Lib Dems and the Greens favour an immediate and outright ban, while First Minister Nicola Sturgeon has said she was "highly sceptical" about the technique.
Ms Cunningham's motion for Wednesday's debate asked parliament to agree that "Scotland's stunning natural environment is one of its most precious assets", and says that "wise and productive use of the country's natural capital is at the heart of a strong, sustainable, low-carbon economy".
She told MSPs that the SNP is "deeply sceptical" about fracking, but said there was "thorough" scientific research being undertaken on the issue.
The environment secretary also pledged to "build resilience" against flooding, and to "work with nature" in habitat restoration and species protection.
On land reform, Ms Cunningham called for greater transparency in land ownership and management, and said consultation over a mandatory public register of landowners would begin this summer.
Labour MSP Claudia Beamish put forward an amendment asking parliament to "recognise that, to meet Scotland's climate change goals and protect the environment, there must be an outright ban on fracking in Scotland".
She said parliament could "send out a very clear signal" by backing a ban, and warned that the SNP was faced with a choice "to side with centre left parties like Labour to stop fracking, or side with the Tories to go ahead with this dangerous plan".
A number of other Labour MSPs also spoke out backing the motion, with several repeating the slogan "no ifs, no buts, no fracking".
Green MSP Andy Wightman lodged another amendment which noted, among other things, that fracking is "incompatible with Scotland's low-carbon ambitions".
Mr Wightman also addressed land reform, describing it as "a process of changing the legal, political, economic and fiscal relationship between society and land across urban, rural and marine Scotland" and calling for "radical and ongoing reform to democratise land".
Calling for a new Land Reform Bill to be introduced in the new term of Holyrood, Mr Wightman called for measures to democratise land use with an emphasis on fairness.
He also called for the council tax to be scrapped and said action should be taken to improve engagement with local democracy.
However, several Scottish Conservatives, led by new MSP Maurice Golden, spoke out in favour of fracking.
Mr Golden said the "left wing cabal" of Labour, the Greens and the Lib Dems was "out of step" with scientific evidence and what consumers want and need.
He said fracking would boost jobs and the economy, and called on the SNP to "make up its mind" and stop blocking it.
Mr Golden said there was a greater impact on the environment from shale gas being shipped to Scotland than there would be from extracting it locally.
SNP energy minister Paul Wheelhouse said he was disappointed that Labour had tried to "sideline" the environment debate by putting fracking front and centre.
He said the government was "deeply sceptical" about fracking, but said its position was "clear"; that there would be "no fracking in Scotland" unless there was clear evidence that it would cause no harm.
He said scientific research and a full public consultation would be carried out.
When members came to vote, SNP members abstained, meaning Labour's amendment passed by 32 votes to 29, with 62 members abstaining.
Mr Wightman's amendment was also passed, before the motion itself was passed by 32 votes to 30, with 61 abstentions.
Read Holyrood Live's coverage of the full debate here.