A teenager accelerated towards a railway level crossing before hitting a train and killing his two passengers, the High Court in Edinburgh has heard.
Wreckage of the car at the scene of the accident
Richard Fleming, 18, from Tain, picked up speed despite the crossing's warning lights being activated.
He admitted causing the deaths of Paul Oliver and Alan Thain, both 17, on 2 February last year at Delny, near Invergordon, by driving dangerously.
Fleming also admitted driving at speeds of up to 108mph weeks before the crash.
This offence, on the A9 road at Kildary, Ross-shire, on 23 December 2006, came two days after he passed his driving test.
Advocate depute Graeme Jessop said two police officers recorded him travelling at 108mph and pulled him over.
Fleming had two passengers in his Ford Fiesta at the time and after he was charged he was allowed on his way.
The same two police officers were coincidentally the first on the scene at the wreckage of his car after he smashed into the underside of the train.
Mr Jessop said on the morning of the fatal crash Fleming was travelling to Inverness College after picking up Mr Oliver and Mr Thain.
Fleming then left the main road and went onto a minor road as he was planning to pick up a third passenger in the village of Milton, who did not show up.
The student turned into the unclassified Barbaraville to Delny road where the level crossing is sited.
The advocate depute said: "The flashing crossing lights on the left hand side, at least, ought normally to have been visible to the accused from the junction 456 metres away.
"The vehicle driven by him picked up speed and appeared to accelerate in the direction of the crossing.
"The accused's car did not make it to the crossing before the train. The train was first to arrive and indeed was partially across before the Ford Fiesta collided with the underside of the leading coach 13m from the front of the train."
Fleming suffered multiple injuries and damaged two vertebrae in his back.
Mr Jessop said: "The only two possible explanations for the collision are either the accused for some reason failed to notice the red lights, or he deliberately chose to ignore the red lights."
The judge, Lord Brailsford, deferred sentence on Fleming and agreed to grant bail.
He said: "I think that in this case there is a high degree of probability that there will be a custodial disposal."