The driver of the train was trapped in his cab for more than an hour after the crash, which happened a mile outside of the Scottish capital, a British Rail spokesman said.
The train was nearing Edinburgh on the 9.43am service from Newquay, Cornwall.
Overhead power lines were switched off last night while emergency services cleared the area. All British Rail services to Edinburgh were suspended, with one London Paddington to Edinburgh service being re- routed to Glasgow and passengers being taken on to Edinburgh by coach.
A spokeswoman for InterCity Cross Country in Birmingham said the incident occurred just after 8.30pm, in the Abbey Hill district of Edinburgh, one mile south of the city's main Waverley station.
The nine-carriage InterCity 125 was slowing down when it collided with the driverless diesel locomotive.
Other services were stopping south of Edinburgh at Drem and travellers were completing their journeys by bus.
The injured were either treated on the scene by paramedics or taken to Edinburgh Royal Infirmary.
A spokeswoman at Edinburgh Royal Infirmary said all the injured were removed from the train within 45 minutes.
Most suffered cuts, bruises and shock. Of the patients being treated, three or four had 'significant injuries', including the driver of the InterCity train who suffered leg injuries. The seriously injured cases would be detained overnight.
Last night aninvestigation was launched into how the accident happened. A ScotRail spokesman confirmed initial reports that the locomotive involved in the crash was moving but had no driver.Reuse content