Rail services on the East Coast Main Line are being brought back under government control.
Transport Secretary Chris Grayling told Parliament that temporary state ownership would provide the smoothest transition to a new operator.
The loss-making service is being renamed London and North Eastern Railway (LNER).
It is the third time in a just over a decade that the government has called a halt to the East Coast franchise.
Mr Grayling told Parliament that after two months of analysis he had concluded that taking the service back into state control was the best option.
“I plan to use a period of operator of last resort control to shape the new partnership,” said Mr Grayling.
He said the aim was to create a new public-private partnership from 2020, with “one single team operating the railway”.
“They will then begin the task of working with Network Rail to bring together the teams operating the track and trains on the LNER network.”
The London to Edinburgh line has been run by a joint venture between Stagecoach and Virgin, since 2015.
The franchise was supposed to run until 2023, but it became clear at the end of last year it was running into trouble. Mr Grayling said earlier this year the franchise would end early, leading to accusations the government was bailing out the current operators.
Mr Grayling said the new arrangement would have no impact on passengers or staff.
Shadow Chancellor, John McDonnell tweeted that he welcomed the move, which he said was implementing Labour’s Manifesto promise to renationalise the railways.
Green Party MP Caroline Lucas tweeted that public ownership should be extended the rest of the rail network.
Mr Grayling told parliament that Stagecoach and Virgin have lost almost £200m, but that there had not been a loss to taxpayers “at this time”.
He said he has received “official advice” that Virgin and Stagecoach should be allowed to continue bidding for future rail franchises.
After looking into problems on the service, Mr Grayling said he was advised “that there is no suggestion of either malpractice or malicious intent in what has happened”.
He added that the firms have paid a “high financial and reputational price” in relation to the East Coast route.
Stagecoach, which has operated the franchise with Virgin Trains since 2015, said the companies had attempted to negotiate a new contract with the Department for Transport, without success.