Holyrood has passed legislation to merge transport policing in Scotland with the national force despite widespread opposition.

MSPs voted by 68 to 53 in favour of the Railway Policing Bill with the Conservatives, Labour and the Liberal Democrats refusing to back the plans.

The Bill will see British Transport Police (BTP) in Scotland subsumed into Police Scotland after the 2016 Scotland Act extended new powers to the Scottish Parliament.

The Scottish Government says the move will make railway policing more accountable but critics include trade unions and BTP officers.

Speaking during the final debate on the Bill at Holyrood, Transport Minister Humza Yousaf said maintaining high standards of safety and security on Scotland's railways was the government's "primary objective".

He said: "The integration of the BTP in Scotland into Police Scotland will deliver an integrated approach to transport infrastructure policing in Scotland, bringing railway policing alongside the policing of roads, seaports, airports and border policing.

"Integration is about providing a single command structure for policing in Scotland so there is access to wider support facilities and specialist resources. These crucially include Police Scotland's counter-terrorism capabilities."

Mr Yousaf said he remained "absolutely committed" to a triple-lock guarantee on jobs, pay and pensions of railway policing officers and staff in Scotland.

He hit out at the Scottish Conservatives opposition to the merger in Scotland, pointing to Tory plans to merge BTP south of the border into a bigger national infrastructure force.

Conservative MSP Oliver Mundell said the government had discounted "the many voices who have raised real concerns about their dangerous plan".

"This proposition is not about the facts, the evidence or what works," he said.

"Instead this ill-judged and ill-thought out idea is before us for one reason and one reason only - this SNP Scottish Government's constitutional and ideological obsession with control."

He added: "This legislation is not fit for purpose. We believe that under this SNP government the risks of a botched job far outweigh any of the supposed benefits.

"What is more we believe the reckless way in which this SNP government has bulldozed its preferred option through this parliament will put public safety at risk on our railways."

Labour's Claire Baker called on ministers to put their plans on hold over Holyrood's summer recess to further consult with trade unions and others about alternative options.

Ms Baker said other options should be "properly explored" but added: "Instead we have a government determined to put legislation through Parliament that can not command consensus."

She continued: "This is a Bill that has no manifesto mandate, it has no public support and very little industry support. This is a Bill with operational concerns and serious financial unknowns.

"So this is a Bill Scottish Labour cannot support."

Mike Rumbles, a Lib Dem MSP, said: "Ministers made up their minds long ago that they were right, and that those in the sector ... were all wrong.

"That is neither sensible, nor healthy, but it is sadly characteristic."

He said concerns had been overlooked by ministers, stating that the merger was "a bad job of their own making".