The head of Russia's National Anti-Terrorist Committee said the blast hit the train between Sennaya Ploschad and Tekhnologichesky Institut stations.
Images posted on social media showed a badly mangled carriage, with a number of casualties nearby.
President Vladimir Putin said all causes, including terrorism, were being investigated.
Initial reports suggested there had been two explosions, one at each of the two stations.
At least 50 people have been reported injured, and a number of children were among those hurt.
Andrei Przhezdomsky, the head of the Russian National Anti-Terrorist Committee, said it was caused by "an unidentified explosive device" but that the exact cause had yet to be determined.
However, a spokesman for Russia's prosecutor general said the explosion was "a terrorist act".
St Petersburg's metro system is the 19th busiest in the world, with more than two million passengers every day. It has not suffered attacks before.
However, several transport hubs in Russia have been attacked. In 2010 at least 38 people died in a double suicide bombing on the Moscow metro.
In 2009, a bomb exploded on a high speed train travelling between Moscow and St Petersburg, killing 27 and injuring another 130.
Both attacks were claimed by Islamist groups.Labels: crime, globalpolitics, latest