The blast, on one of Russia's busiest train lines, happened late on Monday night, local time, near the village of Malaya Vishera in Novgorod, 500km north of the capital.
About 60 of the Nevsky Express's 250 passengers were hurt, some seriously, and 38 were taken to hospital after the derailment, which left carriages strewn on their side along the tracks.
"The train accident was caused by a homemade explosive device," said Sergei Bednichenko, chief prosecutor for Russia's north-west district.
"A criminal case has been opened under article 205, clause three, that is terrorism," he added.
Rebel fighters linked to the insurgency in Chechnya have used bombs to target passenger trains in the past, but no group has claimed responsibility for this most recent attack.
The blast left a 1.5 to 2 metre wide crater across the railway line, and Russian Railways said about 800 metres of track had been badly damaged.
"We heard two explosions, then the train put on the brakes suddenly," one conductor told Reuters. "The train shook. A panic started.
"We smashed out the glass and helped the passengers out… The worst damage was in the restaurant car. That is where most of the casualties were."
"It was terrible," said passenger Viktoria Kovbas. "People were thrown to one side and there was this smell of burning.
"There was an explosion, a real explosion… The restaurant car is crumpled up like an accordion."