Boris Johnson has called for “rancour and division” to be left behind after Parliament approved his Brexit deal, paving the way for the UK to leave the EU with an agreement this month.

The Prime Minister said it felt at times that the “finish line” would not be crossed but heralded having “done it” after peers ended a legislative battle on Wednesday evening.

The Lords had tried to secure additional rights including for unaccompanied child refugees but bowed to the will of MPs after the elected chamber overturned the peers’ demands.

Now the legislation just needs Royal Assent to be formally granted by the Queen and the agreement to be approved by the European Parliament by Brexit day on January 31.

The PM said the nation would “move forwards as one United Kingdom”, adding: “At times it felt like we would never cross the Brexit finish line, but we’ve done it.

“Now we can put the rancour and division of the past three years behind us and focus on delivering a bright, exciting future – with better hospitals and schools, safer streets and opportunity spread to every corner of our country.”

The Queen’s formal approval of the European Union (Withdrawal Agreement) Bill is expected in the coming days while the European Parliament will hold its consent vote on January 29.

MPs had reversed five changes made to the legislation by the Lords during a “ping-pong” phase where the Bill moved between the two Houses until agreement is achieved.

Peers had defeated the Government on EU workers having the right to physical proof of their right to remain and on the power of courts to depart from European Court of Justice rulings.

They also worked to ensure the rights of unaccompanied child refugees to be reunited with their families in the UK post-Brexit.

But all five amendments were comfortably reversed by MPs, with majorities ranging from 86 to 103, before the upper House gave way.

The deal was able to pass the Commons with ease after Mr Johnson secured an 80-strong majority in the general election.