Scotland's transport minister is to invite unions and other political parties to talks next week on setting up a public sector train operator.
Humza Yousaf revealed the move after widespread criticism of existing ScotRail services.
He said the contract could be cancelled in 2020 and contingency plans were in place for the Scottish government to take over train services earlier.
ScotRail said it was working to implement a 246-point improvement plan.
Scottish Labour said Mr Yousaf was "running out of excuses".
Dutch firm Abellio took over the ScotRail franchise in April last year in a 10-year deal worth up to £6bn but with the option for the Scottish government to cancel it at the halfway point.
Since then it has been regularly criticised over punctuality and reliability, with a broken-down train in Edinburgh last week causing widespread disruption.
Speaking on the BBC's Sunday Politics Scotland programme, he said current performance levels were "unacceptable" and confirmed Abellio could be stripped of the contract if punctuality dipped below 84.3% for three consecutive months.
He said: "If the Scottish government, if Transport Scotland had to take over the railways tomorrow, we have contingency plans in place to do that."
According to the latest performance data from ScotRail, 86% of trains were on time or less than five minutes late between 16 October and 12 November.
Mr Yousaf confirmed the Scottish government's preference for a public sector operator to run the service, suggesting this could happen from 2020 when there is a break point in the contract.
'Keep people moving'
He said: "My position is that we're going to put together a public sector bid.
"I'm going to be calling on the unions this week - and indeed other political parties - to join with me in a discussion about how we might put together a viable public sector bid."
The SNP has previously promised to open up the rail franchise to public sector bids, under powers devolved in the Scotland Act 2016.
Mr Yousaf refused be drawn on whether he favoured nationalising the railways in Scotland, pointing out that the Scottish Parliament does not currently have that power.
However, he said there was "a strong argument" for integrating the train operator and Network Rail should such powers be devolved in future.
A ScotRail Alliance spokesperson said: "We are concentrating on delivering rail services as detailed in our Performance Improvement Plan, which contains 246 individual actions to make things better, every single day.
'Delays and overcrowding'
"We are going through the biggest change and improvement in our railway infrastructure since the Victorian era. All of this will take time.
"While we are working on it, we will do everything we can to minimise disruption and to keep people moving. When it is all in place, we will have transformed rail travel in Scotland."
Scottish Labour's transport spokesman Neil Bibby said: "Instead of questioning the motivations of trade unionists working on the railways, the SNP transport minister should hold his hands up and accept responsibility for his failure to deliver a railway network that passengers in Scotland deserve.
"When the SNP awarded the contract to run the railways to Abellio, ministers said it was a 'world-leading' deal, but now today Humza Yousaf has admitted the performance has been anything but.
"Overcrowded trains, delayed trains and cancelled trains: that's the SNP's record under Humza Yousaf. Passengers are fast losing confidence in him - the clock is ticking."