The service is being brought back into public ownership after a string of failures by Stagecoach and Virgin in recent years.
Mr Grayling’s decision marks the third time in under a decade that ministers have had to intervene on the line which was privatised in 1996 when Great North Eastern Railway took the ill-fated franchise.
Stagecoach and Virgin have run the franchise on a 90:10 split since 2015 and had already announced they would be handing it back to the Government three years early after admitting they had overestimated passenger numbers and suffered a revenue shortfall.
In a statement to the MPs, Mr Grayling denied the East Coast line was a failing rail service but admitted Stagecoach and Virgin stood to lose around £200m.
He told MPs the Virgin Trains East Coast partnership would be terminated next month and a new operator of last resort would take control under the London and North Eastern Railways brand.
He said the new LNER service will be a partnership between public and private sectors.
Shadow Transport Secretary Andy McDonald accused Mr Grayling of treating the opposition and the Commons with contempt after withholding his statement until half an hour before he delivered it.
He said: “Every announcement is a smokescreen to divert attention from the failings of the Transport Secretary’s policy.”
Critics of denationalisation fear the collapse of the franchise will cost taxpayers hundreds of millions of pounds.
Mr Grayling said in February that the financial outlook for Stagecoach had rapidly deteriorated in recent months, with the company incurring losses of almost £200m.
The Government had two options relating to the future of the East Coast mainline: nationalising the line temporarily or renegotiating a not-for-profit management deal with the two operators.
The Government had indicated it remained open to the possibility of allowing Stagecoach to keep the franchise until 2020 on a not-for-profit basis.
But ministers have ditched that option and opted instead to take “direct” control of the line.
The renationalisation of the line is expected to last for the next two years.
After 2020 the expectation is for the East Coast mainline to be operated on a new “public-private partnership model”.
Rail, Maritime and Transport union general secretary Mick Cash said: “This is the second time that the Government have called upon the public sector to launch a rescue operation on the East Coast Main Line and instead of being a temporary arrangement Chris Grayling should listen to his staff and the public and make it permanent.
“After three shambolic private sector failures on the East Coast the message should now sink in that these cowboys cannot be trusted and should be locked out of the system on a permanent basis.
“Anything else risks playing out the same expensive farce over and over again. RMT will now be seeking an urgent meeting with the new operator to bolt down guarantees for staff on jobs, conditions and pensions.”
Mr Grayling said: “I will terminate Virgin Trains East Coast’s contract on June 24 2018.
“I plan to use a period of Operator of Last Resort control to shape the new partnership.
“So on the same day we will start with the launch of a new long-term brand for the East Coast Main Line through the recreation of one of Britain’s iconic rail brands, the London and North Eastern Railway, the LNER.
“The team that’s been working for me since last autumn to form the Operator of Last Resort will take immediate control of passenger services.
“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.”
Mr Grayling said he has received “official advice” that Virgin and Stagecoach should be allowed to continue bidding for future rail franchises.
He told the Commons: “A multi-disciplinary panel has considered the situation and recommended that both companies continue as train operators.
“They have advised that there is no suggestion of either malpractice or malicious intent in what has happened.
“Clearly we have to be vigilant about future financial commitments.”
He told MPs the firms have paid a “high financial and reputational price” in relation to the East Coast route.