MSPs have agreed an emergency timetable to rush through the Scottish government's alternative to the EU Withdrawal Bill.
The "continuity bill" has been tabled at Holyrood in case no deal is struck with UK ministers over the Westminster legislation and devolved powers.
Prime Minister Theresa May said the bill was unnecessary and that ministers should focus on hammering out a deal.
But MSPs backed an emergency process by 86 votes to 27.
That means MSPs will look at the bill over the next three weeks.
First Minister Nicola Sturgeon stressed that "we have not given up on seeking agreement with the UK government", but said bringing forward the continuity bill was "something that we required to do to protect the interests of the parliament".
The bill is the latest stage in a row between the UK government and the devolved administrations in Edinburgh and Cardiff over post-Brexit powers.
Both of the devolved administrations are now bringing forward their own legislation, having warned that they will not put forward the EU Withdrawal Bill for consent votes unless a deal can be struck.
There has also been a row over whether the Scottish bill falls within Holyrood's remit, with the presiding officer arguing that it does not - but the Lord Advocate disagreeing.
The bill is being taken forward without the backing of the presiding officer - an unprecedented move for a government bill, and one which may leave it open to legal challenge in the Supreme Court.
Scottish Brexit Minister Mike Russell told MSPs the government supported having the "maximum possible scrutiny" of the legislation, but said an emergency timetable was "necessary" given the "novel situation".
He said Holyrood would be "defenceless" if the EU Withdrawal Bill were to pass without a continuity bill in place, saying the Scottish parliament "must prepare itself to assert, if it has to, the right to legislate for itself the devolved consequences of EU withdrawal".
Scottish Conservative constitution spokesman Adam Tomkins disagreed, saying that there did not need to be an emergency procedure because "there is no emergency".
He warned that rushing through the bill "denies effective scrutiny", saying that "when we legislate in haste, we legislate in error" - calling the move "an invitation to make bad law, and make law badly".
Scottish Labour's Neil Findlay also warned that scrutiny could be "severely curtailed" by a "truncated" parliamentary process, saying Labour had "very serious concerns" over the bill being considered only in the Holyrood chamber and not in committee.
However, Labour MSPs ultimately backed the move, as did all members barring the Conservatives.
The first stage of consideration of the bill will take place on Wednesday 7 March, with the final vote scheduled two weeks later.
Further talks between the two governments are to continue, with ministers meeting in the coming week and Ms Sturgeon noting that a plenary session of the joint ministerial committee - traditionally attended by both herself and the prime minister - is currently scheduled for 14 March.