MSPs have formally protested against changes to the UK benefits system, which some claim will see cuts in payments to the most vulnerable.
SNP and Labour members of the Scottish Parliament took the unprecedented step of voting against a Westminster "consent" motion.
Holyrood cannot stop Westminster changing the welfare benefits system.
But the UK government wanted Holyrood to allow it to change the law so its reforms would fit the Scottish system.
The UK government said the Welfare Reform Bill would save billions of pounds by replacing Disability Living Allowance with a personal independence payment and replacing a range of other benefits with a single universal credit.
But these changes will have a knock-on effect for devolved services such as social care and devolved entitlements such as free school meals.
MSPs voted to turn down Westminster's consent request in favour of making the necessary legal changes themselves.
It is the first time Holyrood has refused Westminster legislative consent.
Scottish Health Secretary Nicola Sturgeon said the changes to welfare proposed by the Tory-Lib Dem coalition at Westminster would result in damaging cuts to benefits for some of the most vulnerable people in Scotland.
The UK government denied it was targeting the disabled and vulnerable.
It said the changes under the bill, due to come into effect in 2013, would save £7bn in welfare spending and encourage people currently on benefits to go out and find a job.
It has proposed moving to a single universal credit from 2013, to be paid to people both in and out of work.
The bill replaces child tax credit, working tax credit, housing benefit and income support, among others - but critics argue many in need of vital support will be worse off.
SNP and Labour MSPs voted 100 to 18 to refuse to back the necessary legislative consent motion on parts of the UK government's Welfare Reform Bill where the Scottish Parliament has legislative competence.
The UK motion included the introduction of universal credit and personal independence payments.
The Scottish government will now need to bring forward its own legislation to ensure policies tied to the UK benefits system continue to operate in Scotland.
Ms Sturgeon said: "We recognise the welfare system is broken and needs to be fixed, but not at the expense of our most vulnerable people.
"Put simply, the Scottish government supports a welfare system that is simpler, makes work pay and lifts people out of poverty, however, this approach is being fundamentally undermined by the UK government's deep and damaging cuts to benefits and services that will impact on some of the most vulnerable people in Scotland.
"We have put on the record time and time again our long-standing concerns about the lack of detail around key elements of the bill, which will have serious implications for devolved policies and services."
Labour health spokeswoman Jackie Baillie said the UK reforms were the single most significant attack on the welfare state in her lifetime.
"The starting point for this reform is not about fairness or supporting people back into work, it is purely about saving money, often from the most vulnerable people in our communities," she said.
"And, in Scotland, this amounts to a cut of £2bn, which will have a direct impact on household spend and economic growth."
But Conservative health spokesman Jackson Carlaw said the SNP and Labour had brought forward a "hollow blank canvas of lurid rhetoric".
He said the creation of universal credit would "transform the lives of millions for the better", adding: "Nothing we do today will alter the course of the UK Welfare Reform Bill, and to suggest otherwise is to deceive those affected and to give quite false expectations to those whose circumstances will change."
And Liberal Democrat MSP Liam McArthur said refusing consent would harm "the interests of many that those who advocate such a course profess to be defending".
He said: "At best, it seems to be a gesture, but one with potentially serious consequences."
MSPs had previously heard concerns that the Welfare Reform Bill would increase pressure on homelessness and social care services and force disabled people to move home.
Children's groups also claimed it could plunge between 50,000 to 100,000 youngsters into poverty.
Martin Sime, chief executive of the Scottish Council of Voluntary Organisations, said: "SCVO has always accepted that some welfare reform is necessary and welcome, but it is disappointing that the Westminster government has not chosen to make changes to reflect the very real and deep concern expressed about the consequences of their proposals for the most vulnerable members of our society."
Bill Scott, of disability organisation Inclusion Scotland, added: "Even at this eleventh hour, we hope that the UK government might re-discover its conscience and halt reforms which will impoverish and severely limit the independence of tens of thousands of disabled people."
Following the vote, the UK Welfare Reform Minister, Lord Freud, said: "This is the wrong decision for thousands of people who have now been effectively written off to a life on benefits.
"With one in five workless households and families where generations have not worked, something has to change.
The best way to help those families is to make work pay and universal credit will do that.
"Its disappointing that Scottish government says it wants fairness and simplicity but does not support proposals that could make such a radical difference to the lives of thousands of families."
Despite the opposition, MSPs are understood to support other aspects of the Welfare Reform Bill, under the legislative consent motion, including changes to data sharing, industrial injuries benefits and a new commission on social mobility and child poverty.
The Scottish Parliament also unanimously backed the creation of a new committee dealing with the issue of welfare.