Boris Johnson’s Brexit deal has become law after it received royal assent from the Queen, having cleared all its stages in parliament.

Tory MPs cheered the deputy speaker Nigel Evans as he confirmed in the House of Commons on Thursday that there was now a European Union (Withdrawal Agreement) Act.

Johnson finally succeeded in getting his bill through the Commons and the Lords after several failed attempts by his predecessor Theresa May.

He was not in the Commons to hear the news, but said the moment was a significant milestone. “At times it felt like we would never cross the Brexit finish line, but we’ve done it,” he said.

While the Tories cheered, the SNP Westminster leader, Ian Blackford, registered his anger at the “constitutional crisis” that passing a Brexit bill against the wishes of Scotland and other devolved nations had caused.

“We are faced with a situation which is completely unprecedented when the government in Edinburgh, Belfast and in Cardiff has not given consent to this act of parliament. That completely contravenes the devolution settlement that made it clear that the consent of the devolved administrations had to be given in bills of parliament that become acts of parliament that involve the devolved administrations,” he told MPs.

“We find ourselves here today, that our parliament has been ignored, our government has been ignored and, against the expressed wishes of the people of Scotland that voted in the referendum and reaffirmed the right of the people of Scotland to determine their own destiny, that that has been ignored.”

The withdrawal agreement bill started its progress through the Commons just after Johnson won his 80-strong majority in December.

It completed its passage through both chambers on Wednesday after the Lords backed down on four amendments that it had tried to secure earlier in the week.

Peers voted for commitments on allowing child refugees to come to the UK and for EU citizens to get physical proof of their settled status, but MPs overturned the changes.

The royal assent for the bill means the UK is set to leave the EU on 31 January, as long as the European parliament approves the deal as well.