Rescue efforts had been an agonizing 100-hour exercise in frustration as the teams repeatedly inched their way through tangled debris and fallen rock only to have to withdraw because of explosively high levels of methane and carbon monoxide.

Above ground, the miners’ families waited for word. Passing much of the week sequestered from the news media, they huddled together in an open-air warehouse on the mine’s sprawling property, eating pizza, whispering consolations to each other, and sometimes praying.

While rescue efforts continued, company and state officials had been reluctant to release the names of the dead and missing, a move that angered many families longing for closure.

The death toll caused by Monday’s explosion was the highest in an American mine since a 1970 explosion killed 38 at Finley Coal Company, in Hyden, Ky. The blast at Upper Big Branch comes four years after a pair of other West Virginia mine disasters — an explosion that killed 12 miners at the Sago mine and a fire that killed two at the Aracoma Alma coal mine.

“We remained hopeful the four missing miners would have been found alive,” Don Blankenship, the chief executive of Massey Energy, the mine’s operator, said in a statement. “I personally met with many of the families throughout the week and share their grief at this very painful time.”

In 2008, the Aracoma Coal Company, a subsidiary of Massey, agreed to pay $4.2 million in criminal fines and civil penalties and to plead guilty to several safety violations related to that fire.

This week’s disaster came as a particular surprise because last year there were only 34 mining deaths, a record low.