On Monday, two bombs ripped through crowds packed in to watch the Boston Marathon, killing three and injuring at least 170 others. 

Fortunately for victims of the attacks, Boston and the surrounding metro area are home to a number of medical facilities, including some of the nation's top hospitals — and doctors. Perhaps more so than most cities, Boston had the resources on hand to deftly handle a crisis of that magnitude.

With nearly 80 hospitals and a bevy of medical schools, the city has an expansive medical network that can absorb a heavy influx of patients, ensuring that patients receive treatment as quickly as possible. According to The Boston Globe, eight area hospitals had treated nearly 150 patients as of Tuesday afternoon. Massachusetts General, Boston Medical Center, St. Elizabeth's Medical Center, Brigham and Women's Hospital, Tufts Medical Center, and Beth Israel ­Deaconess all treated more than a dozen patients each. Boston Children's Hospital treated an additional eight patients. 

On scene, the wave of first responders converted a medical tent into a makeshift infirmary, treating victims and stabilizing those with more serious injuries before sending them off to the various hospitals. Those first responders reportedly included some doctors racing in the marathon who stopped to tend to victims on site. As the injury tally mounted, off-duty doctors rushed in to help; an additional 100 medical personnel headed to Beth Israel alone.

That's all on top of the already-increased staff levels at area hospitals, which typically add more shifts to handle common race injuries on Marathon Monday.

"I've never been prouder to work here," Dr. Andrew Ulrich, executive vice chairman of Boston Medical Center's Department of Emergency Medicine, told the Boston Herald. "The staff response was outstanding."

As a medical hub, Boston's hospitals are renowned as being among the country's best. Last year, U.S. News & World Report named Massachusetts General (MGH) the top hospital in the nation in its annual "Best Hospitals" list. Brigham and Women's Hospital took ninth place, while 20 Boston hospitals received some kind of ranking. Only six cities — all of them considerably larger than Boston, including New York, Chicago, and Los Angeles — are home to more ranked facilities on that list than Boston.

In a separate report, U.S. News also named Boston Children's as the best pediatric hospital in the nation, tied with the Children's Hospital of Philadelphia. And two other studies, released in 2009 and 2011, both named Boston as one of the top five medical cities in the country.

"It is fortuitous that the Boston hospitals involved, including Massachusetts General Hospital, Boston Children's Hospital, and Tufts Medical Center, are among the country's best," says Marc Siegel in Forbes. "Trauma surgeons are trained in these kinds of injuries, and several Boston surgeons have experience in Iraq and Afghanistan that they can bring to bear."

Given the high number and high caliber of hospitals in Boston, Massachusetts' medical centers routinely receive a huge share of federal health dollars. In 2012, state facilities received $2.4 billion in funding from the National Institute of Health, or roughly 11.3 percent of the NIH's entire state-level outlays for the year. Only California received more funding. 

Boston has also earned more NIH funding than other other city in the country for 17 years straight, according to the Globe. In that span, the city's medical institutions have been awarded a combined $23.4 billion.

Boston's doctors may also have been particularly well equipped to handle a major disaster response effort. When the State Department evacuated Libyan rebels to the U.S. two years ago so that they could receive special treatment for their wounds, those patients went to a hospital just outside Boston. And at Mass General, Israeli disaster response experts have worked directly with the hospital to prepare for an urban attack like this one.

"We ­obviously have a limited experience with explosions in an ­urban area," Dr. Alasdair Conn, MGH's chief of emergency services, told the Boston Globe. "The Israelis, unfortunately, have this several times a year, and we asked their disaster-response teams to come and help us upgrade our disaster response."

"And I'm very pleased that we went through that orientation and additional training," he added.