ScotRail will come under Scottish Government ownership from next year.
Services will be provided from the moment Abellio's franchise expires.
That is expected to happen next March.
Rail services are going to be provided by an arm's length firm owned and controlled by the government.
It's thanks to a decision to run services through what is known as the "Operator of Last Resort".
There has also been an announcement to implement further Emergency Measures Agreements (EMAs) for ScotRail and Caledonian Sleeper franchises from next month.
This will last from 1 April until September this year.
Michael Matheson MSP, Scotland's Transport Secretary, said: "With the current ScotRail franchise expected to end in March 2022, we need to take decisions about successor arrangements within the current legislative framework.
"We have for some time been considering the full range of options available under that framework for continuing services beyond the franchise expiry."
Mr Matheson said he wanted to give passengers and staff "as much certainty" as possible about the future.
He added: "ScotRail staff will transfer to the new Scottish Government owned entity, with their terms and conditions protected.
"This approach will provide a stable platform for ScotRail services and certainty for passengers and staff."