ST. PETERSBURG, Russia — It was 2:40 p.m. on Monday, a lull before the evening rush hour in Russia’s second-largest city, St. Petersburg, where the subway normally carries two million people a day. The train had just entered a tunnel between stations, on its way out of a sprawling downtown hub, when the bomb exploded.

The homemade device, filled with shrapnel, tore through the third car. It killed 11 people; wounded more than 40, including children; and spread bloody mayhem as the train limped into the Technology Institute station with smoke filling the air.

Videos circulating on social media showed long red streaks across the white floor as the injured were dragged from the car. With the doors damaged, some people smashed windows to get out. “What a nightmare!” somebody yelled amid piercing screams.

With the attack, Russia once again appeared to have found itself a target of terrorism, shattering a respite in its main urban centers. Law enforcement agencies initially said they were seeking two people suspected of planting explosive devices, according to Russian news reports, but later indicated that the attack might have been carried out by a suicide bomber from a militant Islamic group.

There was no immediate claim of responsibility, but speculation turned toward militants from southern Russia, who fled the shoot-to-kill law enforcement policy in Chechnya and elsewhere in the Caucasus, joined the Islamic State by the thousands and have repeatedly threatened attacks. President Vladimir V. Putin sent the Russian military to Syria in September 2015 in order, he said then, to battle militants on their own turf before they could strike in Russia.