The Scottish Government has announced that the Scottish train services are to be run by a public sector body.
Dutch firm Abellio will stop running the ScotRail franchise at the end of March 2022.
They have been running the franchise since 2015 but had its contract ended early amid criticism over cancellations and performance levels.
After this an "arms-length" Scottish government company will take over the running of services.
All ScotRail staff will transfer to the new Scottish government-owned entity.
The arrangement is being made under powers which allow the Scottish government to take over the rail franchise without a bidding process.
Transport Secretary Michael Matheson said he was not able to say how long these "operator of last resort" arrangements would last for.
He said: "I have decided that it would not be appropriate to award a franchise agreement to any party at this time, either through a competition or a direct award.
"That is why I have confirmed that, from the expiry of the current franchise, ScotRail services will be provided in public hands through a company wholly owned and controlled by the Scottish government.
"This approach will provide a stable platform for ScotRail services and certainty for passengers and staff."
In February this year, The Wales and Borders rail franchise went into public ownership after being nationalised by the Welsh Government.