Asylum and immigration reforms that have caused a great deal of debate in the UK are poised to become law after peers halted their stand-off.

The bruising tussle over the Nationality and Borders Bill ended after the House of Lords rejected by 212 to 157 a last-ditch bid to ensure provisions in the legislation complied with the UK’s international obligations towards refugees.

There were cries of “shame” from some peers as the result was announced.

Contentious provisions in the bill include offshoring asylum, with the government already having struck a deal with Rwanda, and making it a criminal offence to knowingly arrive in the UK illegally.

It also allows for asylum seekers to be treated differently based on how they entered the UK.

The bill had been mauled during its passage through the unelected chamber, but the changes made during the process known as parliamentary ping-pong were repeatedly overturned by the Commons, where the government has a majority.

This included an unsuccessful bid to enable asylum seekers to work if no decision had been taken on their claim after six months.

Disagreements over the legislation went to the wire, with the government wanting to prorogue Parliament on Thursday, ending the current parliamentary session.