“It’s heartbreaking,” Howard said afterward. “It just hurts.”

Of course it does, if only because the United States somehow managed to tiptoe along the precipice of glory even as it endured an unyielding Belgian barrage. Howard, who grew up in New Jersey and played in Major League Soccer before moving to the English Premier League in 2003, made 16 saves, the most by a goalkeeper in a World Cup game since 1966. Yet even with that incredible imbalance — the United States managed just 14 shots to Belgium’s 38 — the Americans will rue a missed opportunity to win in regulation (when Chris Wondolowski missed an easy chance, although there was lingering confusion about whether there was an offside call) and a golden chance to force a shootout in extra time (when Clint Dempsey was stopped from five yards out by the Belgian goalkeeper).

Image Julian Green (16) after scoring a goal against Belgium that cut the U.S. deficit to a single goal. “We wanted to go home going for it,” Michael Bradley said after the game. “And we did.” Credit... Marcos Brindicci/Reuters

Ultimately, there was just not enough from the Americans. Three draining group games in far-flung locations — including a trip to the stifling heat of the Amazon — left the team gasping for air at the finish. Romelu Lukaku, a substitute, scored for Belgium in the 105th minute, and his goal proved to be the difference.

“We were running on fumes,” defender Matt Besler said.

When it was over, the fans at the shimmering Arena Fonte Nova applauded knowingly, as if paying tribute to the ride this team provided. Americans purchased more tickets to games at this tournament than fans from any country other than Brazil. Television ratings in the United States blasted through ceilings, surpassing those of the N.B.A. finals or the World Series. Watch parties popped up in places far more varied than just craft breweries in Brooklyn, with fans gathering everywhere from Hermosa Beach in California to a library in Birmingham, Ala., to the Tulsa Drillers’ minor league baseball stadium in Oklahoma.

Image Employees at the offices of Percolate, a digital content company based in SoHo, watched as the United States botched a late scoring attempt. Credit... Benjamin Norman for The New York Times

A gathering at Grant Park in Chicago was moved to Soldier Field to accommodate a crowd reported to have exceeded 25,000.