BELO HORIZONTE, Brazil — The fireworks began at dawn. All around this city, loud pops and bangs rang out as men and women and children, so many dressed in yellow, set off flares and beeped car horns. It was supposed to be a magical day. The Brazilian national soccer team, playing at home, was one game away from a World Cup final.

No one could have guessed the tears would come before halftime. No one could have imagined there would be flags burning in the streets before dinner. Certainly no one could have envisioned that any Brazilian fans, watching their team play a semifinal in a celebrated stadium, would ever consider leaving long before full time.

It all happened. The 2014 World Cup, first plagued by questions about funding and protests and infrastructure and construction, then buoyed by scads of goals and dramatic finishes and a contagious spirit of joy from the local residents, will ultimately be remembered for this: the home team, regarded as the sport’s superpower, being throttled like an overmatched junior varsity squad that somehow stumbled into the wrong game.

The final score was Germany 7, Brazil 1. It felt like Germany 70, Brazil 1. By the end, the Germans were barely celebrating their goals anymore, and the Brazilians, starting with their coach, Luiz Felipe Scolari, could manage little more than blank stares. In the stands, the Brazilian fans — the ones who stayed around, at least — passed the time by cycling through obscene chants about each player, as well as the Brazilian president, Dilma Rousseff.

“I think,” Scolari said afterward, “that it was the worst day of my life.”

He was surely not alone in that sentiment. Sports are often a haven of hyperbole, but there was little risk of that here on Tuesday. Given the circumstances and the stakes, this result — a soccer massacre of the highest order — may well be remembered as the most surprising in World Cup history.

At the very minimum, it will go down as Brazil’s worst loss, surpassing a 6-0 defeat by Uruguay in 1920. It was also Brazil’s first loss in a competitive home game since 1975, a stretch of more than 14,000 days. For more than six decades, Brazilians had been hoping to erase the embarrassment of their team’s defeat in the 1950 World Cup final — also against Uruguay — which denied them a championship the last time they hosted their favorite sport’s biggest tournament.

Somehow, the fans came away from this World Cup with a nightmare even darker.

“It was the biggest embarrassment of all World Cups — 7-1 in a semifinal playing at home?” said Marcel Guimarães, 38, who traveled to Belo Horizonte from Brasília. “Not even in a video game.”

The aftermath of Brazil’s defeat could turn ugly. There were reports of a mass robbery at a fan party in Rio de Janeiro and of fans setting fire to Brazilian flags in the streets of São Paulo even before the match was over. Local organizers and government officials have been concerned for weeks about the possibility that demonstrations — which have, for the most part, been subdued — would become more intense if Brazil were to be eliminated.

Many Brazilians have been upset about the billions of dollars spent on new stadiums and other World Cup-related projects. The success of the national team provided a natural balm, but now those emotions may become more inflamed.

Video

Brazilian fans grieved in the streets after their team’s historic loss to Germany on Tuesday.

“The time of bread and circus is over,” said Lisa Rodrigues da Cunha Saud, who attended the game with her brother. “Instead of stadiums, we need hospitals and schools,” she added.

The record will show that Brazil played this match without its top scorer, Neymar, who was injured in the quarterfinals, as well as without its top defender, the captain Thiago Silva, who was suspended. As important as both players were to Brazil, however, it is difficult to imagine either one having made much of a difference.

The Germans were merciless, playing with grace and unity and a raw power that saw them rip open the Brazilian defense as if it were a can of soup. Thomas Müller opened the scoring in the 11th minute, blasting home a corner kick from just six yards out. Miroslav Klose followed about 12 minutes later, knocking in a rebound to record his 16th career World Cup goal and become the tournament’s all-time leading scorer.

By then, the mood at the Estádio Mineirão had already deflated, but the fans had no idea what was yet to come. In the next six minutes, Germany scored three more goals — a stretch roughly equivalent to a boxer landing three uppercuts in a row in the first round — which essentially ended the match before a half-hour had been played. Toni Kroos scored two of those goals; Sami Khedira added the other.

“I couldn’t change anything,” Scolari said. “It was one goal after the other. There was nothing to be done during that breakdown.”

The second half — yes, they played the second half — was more of the same. André Schürrle scored two more goals for Germany. Brazil kicked the ball around as if in a stupor. Spectators poured out of the stadium in agony, leaving a small German contingent who happily stayed in their seats and sang and sang. A few German players even ran over to take pictures with the fans after the rout was complete.

“If someone had said before that we are going to win 7-1,” Kroos said, “I would certainly not have believed it.”

Oscar, a Brazilian midfielder, did manage to score for the home team in the final minutes, but the goal prompted little excitement. By then, reality had set in: Brazil will leave this tournament having never played a game at the Estádio do Maracanã in Rio de Janeiro. The final will be played there on Sunday, but it will be Germany walking onto this country’s most famous stage to face either the Netherlands or Argentina in a bid for its fourth World Cup title.

Brazil will play on Saturday in Brasília instead, facing the loser of the other semifinal in the third-place match. Scolari tried his best to say it would be an important game, but there was little feeling in his words. Just regret.

Scolari shrugged then, and trudged out of the news conference room, heading down a narrow hallway. The sunrise fireworks seemed so far away. They had been a rousing beginning, a boisterous start to a day Brazilians hoped they would always remember. Then came a German juggernaut, and a game that a nation of soccer fans can only hope to forget.