A pool of blood formed, and huge shards were missing from window panes as high as three stories.
Boston police said two people were killed. Hospitals reported at least 105 injured, at least 15 of them critically.
Some 23,000 runners took part in the race, one of the world's oldest and most prestigious marathons. One of Boston's biggest annual events, the race winds up near Copley Square, not far from the landmark Prudential Center and the Boston Public Library. It is held on Patriots Day, which commemorates the first battles of the American Revolution, at Concord and Lexington in 1775.
Boston Police Commissioner Edward Davis asked people to stay indoors or go back to their hotel rooms and avoid crowds as bomb squads methodically checked parcels and bags left along the race route. He said investigators didn't know precisely where the bombs were planted or whether they were hidden in mailboxes or trash cans.
He said authorities had received "no specific intelligence that anything was going to happen" at the race.
The Federal Aviation Administration barred low-flying aircraft from within 3.5 miles of the site.
Obama was briefed on the explosions by Homeland Security adviser Lisa Monaco. Obama also told Mayor Tom Menino and Gov. Deval Patrick that his administration would provide whatever support was needed, the White House said.
"We still don't know who did this or why," Obama said, adding, "Make no mistake: We will get to the bottom of this."
A few miles away from the finish line and around the same time, a fire broke out at the John F. Kennedy Library. The police commissioner said it may have been caused by an incendiary device but didn't appear to be related to the bombings.
The first loud explosion occurred on the north side of Boylston Street, just before the photo bridge that marks the finish line. The second explosion could be heard a few seconds later.