PARIS — Defying the bitterly low expectations of a populace that had largely written them off as prima donnas, the French national soccer team defeated Ukraine, 3-0, on Tuesday night and secured a place at the 2014 World Cup in Brazil.

First-half goals by Mamadou Sakho and Karim Benzema and a fortunate bounce off a Ukraine defender for an own goal in the second half completed a comeback that had seemed impossible to many.

Ukraine had upset France, 2-0, in the first leg of their home-and-home playoff, a defeat that seemed to augur France’s elimination and a potential new low for a team that has inspired more resentment than love in recent years. France’s team has not yet shaken off the ignominy of its early exit from the 2010 World Cup in South Africa, where it failed to win a game and endured a player revolt that, at one point, led the team to refuse to practice.

The debacle led to the resignation of the coach and the reorganization of the federation under a new president. Still, commentators across the country had projected the worst for Les Bleus on Tuesday, noting that the team, whose roster features European stars like Real Madrid’s Benzema and Bayern Munich’s Franck Ribéry, had consistently underperformed. Comparisons were drawn between the seemingly doomed state of the team and the depressive state of the French economy.