The island's military spokesman, Brigadier Udaya Nanayakkara, said seven people, including a pregnant woman, were killed and another 62 wounded.
He blamed the Liberation Tigers of Tamil Eelam (LTTE) for the attack, which occurred during evening rush hour at Dehiwela railway station in the southern suburbs of Colombo.
An AFP photographer at the scene saw five bodies inside the wreckage of a carriage ripped open by the blast.
State television said around 200 people were on board the train at the time of the attack.
Colombo has been hit by a string of bombings against both civilian and security targets in recent months, with authorities pointing the finger at Tamil Tiger rebels.
There was no immediate comment from the rebels, who are fighting to carve out a separate Tamil homeland in the north and east of the ethnic Sinhalese-majority island.
Fighting has escalated in Sri Lanka since the start of the year, when the government pulled out of a Norwegian-brokered truce with the Tamil T