Police Scotland will take over railway policing when the function is devolved, Scotland's justice secretary has decided.
The move means that the British Transport Police (BTP) will no longer operate as a separate force in Scotland.
BTP wanted to continue providing this service, with oversight by Holyrood instead of Westminster.
But Justice Secretary Michael Matheson has decided against that.
He wants the force's Scottish operations and more than 200 officers integrated into Police Scotland.
In a statement, the Scottish government said: “Police Scotland is responsible for all policing in Scotland outwith the railways and we believe the functions of the British Transport Police should be integrated within the single service.
“The BTP provide a specialist function that is recognised and valued by the rail industry and its passengers and it is essential that this specialism is maintained within Police Scotland.
SNP ministers had a high-profile dispute with the British Transport Police over its use of stop and search when they first took office.
Mr Matheson told the Police Oracle website that railway policing needed to become part of Police Scotland because of the country's “distinctive approach to policing”.
And he told BBC Radio's Good Morning Scotland programme: “Police reforms have been taking place in Scotland over the last 18 months, moving to the single force.
“It's been the Scottish government's view that this [transport policing] would be better if it was integrated into Police Scotland given that it would sit alongside our national police service.
“That's why we believe this would be a better fit for how we are taking policing forward in Scotland.”
The Smith Commission on further devolution recommended that policing the railway be devolved and this was included in draft legislation drawn up by the UK government.
This is expected to become law after the general election and the BTP could become part of Police Scotland by the end of 2016.
A UK Department for Transport spokesman said: “How rail transport is policed in Scotland will be a matter for Scotland once the legislation is passed.”
Labour MP Tom Harris was the minister responsible for the British Transport Police in 2007-08.
“BTP is a long-standing and effective police force” he said.
“It will be sad to see it merged with Police Scotland as part of a further centralisation of services.
“This move is premature. No-one has been consulted – neither the travelling public nor the police officers themselves. A hasty decision today could put at jeopardy the safety of the travelling public tomorrow.”
Scottish Liberal Democrat leader Willie Rennie said: “Some people have argued that the Scottish Parliament should choose to keep the force as one single entity across the UK instead of integrating into Police Scotland.
“I think that is worthy of consideration. We need to have that debate. We need to consider this carefully rather than deciding now what the structure should be.”
BTP has 231 officers in Scotland according to the BTP federation website and a network of 11 offices within major railway stations.
It is dwarfed by Police Scotland which is the largest force in the UK outside London, with more than 17,000 officers.
Under one possible model, BTP could become the Scottish Transport Police division of Police Scotland.
The Scottish Police Authority, which oversees the work of Police Scotland, said it had already started discussions with the BTP.
BTP and its governing body are due to meet to consider their response to the Scottish government's plan.
The cross-border force is worried that losing its Scottish division could lead to the break-up of the entire force.
There have been previous discussions about the Metropolitan Police taking over railway policing in London.
BTP is not the only police force operating in Scotland alongside Police Scotland.
The MOD police and the Civil Nuclear Constabulary will continue to protect key sites.