The blasts shattered the carnival atmosphere of one of the biggest sporting events in the US, causing panic and confusion.
Boston police said a third incident occurred at the city's JFK Library and was under investigation.
The cause of the explosions has yet to be identified.
President Barack Obama is to address the nation shortly.
Continue reading the main story
I was in Washington Square, about two miles from the finish line, where a band was playing and there was a carnival atmosphere.
Suddenly the news started to filter through that there had been an explosion near the finish line.
The music turned off and the mood changed quickly. People reached for their mobile phones to reassure loved ones, and the crowds dissipated fast.
Small groups of runners and their supporters huddled together, pooling information and trying to find out just what had happened in Boston on marathon day.
At the scene
It was a beautiful day in Boston, and everyone was in high spirits for the marathon.I was in Washington Square, about two miles from the finish line, where a band was playing and there was a carnival atmosphere.
Suddenly the news started to filter through that there had been an explosion near the finish line.
The music turned off and the mood changed quickly. People reached for their mobile phones to reassure loved ones, and the crowds dissipated fast.
Small groups of runners and their supporters huddled together, pooling information and trying to find out just what had happened in Boston on marathon day.
Boston's police commissioner has urged people in the city to stay indoors, and not congregate in large groups.
The city mayor's office has set up an emergency hotline for friends and relatives on +1 617 635 4500.
A spokeswoman for Massachusetts General Hospital in the city told Reuters news agency that it was treating 19 victims of the explosions in its emergency room, but information about their condition was not immediately available.
The Federal Aviation Administration has created a no-fly zone over the area, while security at key sites in Washington DC and New York has been tightened.
A White House official said President Obama had called Boston Mayor Tom Menino and Massachusetts Governor Deval Patrick to offer federal assistance.
Vice President Joe Biden - breaking off from a telephone conference call on gun control - said: "Our prayers are with those people in Boston who have suffered injury."
'Massive explosion'
The first explosion came at about 14:50 local time (18:50 GMT), approximately two hours after the winners crossed the line.
There was a loud explosion on the north side of Boylston Street, just before the finish line. Another loud explosion occurred a few seconds later, and smoke rose from the scene of the blasts.
Continue reading the main story
The Boston Marathon
- World's oldest annual marathon - 2013 was the 117th event
- Second biggest single-day sporting event in the US behind the Super Bowl, in terms of media coverage
- Organised by the Boston Athletic Association, the course is 26.2 miles
- This year there were 28,000 runners, representing athletes from every US state and more than 90 countries
- More than 500,000 spectators line the course every year
- $806,000 (£527,000) in prize money offered in 2013
- In 1975, Boston became the first major marathon to include a wheelchair division
- A Kenyan or Ethiopian man has won the Boston Marathon 23 times in the last 25 years
Bloodied victims were initially rushed to a medical tent set up to care for fatigued runners.
Emergency services descended on the scene, which was quickly locked down.
Stragglers heading for the finish line were rerouted away from the smoking site of the blasts.
Mike Mitchell of Vancouver, Canada, a runner who had finished the race, said he was looking back at the finish line when he saw a "massive explosion."
Smoke rose 50ft (15m) in the air, he told Reuters news agency, and people began running away and screaming after hearing the noise. "Everybody freaked out," he said.
The annual Boston Marathon attracts a large field of runners and hundreds of thousands of spectators.
British police are reviewing security plans for Sunday's London Marathon, the next major international marathon, following events in Boston.
bbc.com