Police are appealing for witnesses after a heavy object was launched at a train as it passed through South Elmsall station.
British Transport Police investigations are taking place after the object was thrown at the train window around 9.20pm on Thursday, May 30.
It damaged the window and shattered part of the side of the train.
PC Mark Hibbert, the investigating officer, said: “Just after passing the station, a heavy object was thrown from a footbridge causing the driver’s side window to shatter, and damage the side of the train.
“On this occasion, it was sheer luck that the object didn’t go through the glass and cause injury to the driver.
“The impact of the object was close to the driver’s head and the consequences could have been far worse, putting the driver’s, and passengers’ lives in danger.”
Two youths were seen standing on the bridge at the time, which is thought to lead from Beaumont Avenue to Minsthorpe Vale.
PC Hibbert added: “If you were in the area at the time and saw anyone acting suspiciously, or know anything about the incident, then please get in touch as a matter of urgency.”
Anyone with information should contact British Transport Police by calling Freefone 0800 40 50 40 or texting 61016 quoting B4/NEA of 07/06/2013.
Alternatively, contact the independent charity, Crimestoppers, anonymously on 0800 555 111.