RIO DE JANEIRO — After climbing the ranks of Brazilian soccer, the team was on its way to face one of its biggest tests yet: a chance to win the final of the Copa Sudamericana, an international competition for South American soccer.

But over the mountains near Medellín, Colombia, the plane carrying the members of Chapecoense, a soccer team from a scrappy industrial city in southern Brazil, made an emergency call on Monday night after experiencing an electrical failure, the authorities said.

Moments later, it crashed into the mountains with 77 people aboard.

Only six people survived the crash, aviation officials said: three players, two crew members and a journalist who was accompanying the team. The rest were presumed dead, a devastating turn for one of the most remarkable success stories in the tumultuous, scandal-plagued world of Brazilian soccer.

“This is a relatively small city, so everyone knows somebody who was on the plane,” said Roberto Panarotto, 44, a professor of media studies in Chapecó, the team’s hometown. He said he had lost a childhood friend, a member of the coaching staff, in the crash.

Fans across Brazil had been reveling in Chapecoense’s performance. Brazil has been grappling with extraordinary upheaval this year, including the impeachment of its president, the most severe economic crisis in decades and a jaw-dropping array of political corruption scandals.

In the world of Brazilian sports alone, the United States Justice Department has indicted the most powerful executives in Brazilian soccer on graft charges. A former governor of Rio de Janeiro, who helped land the 2016 Summer Olympics, is in jail on charges that he took bribes in a deal to renovate the city’s Maracanã stadium.