BRAZIL has gone surf crazy.

In December, when a 20-year-old Brazilian named Gabriel Medina won the world’s premier surfing title, becoming the first South American man to do so, the country erupted in celebration. Mr. Medina’s path to the championship had been followed closely in Brazil throughout 2014, each victory celebrated in typically boisterous Brazilian fashion by flag-waving, often teary, always emotional fans. His arrival at the airport in São Paulo after winning the title was a mob scene and a media frenzy.

But Mr. Medina is only the most visible exponent of a rising generation of surfers known by the collective moniker “the Brazilian Storm.” This year, seven of the 34 male contenders on the championship tour are Brazilian — a striking percentage in a sport long dominated by Australians, Americans and South Africans. The first event of the year, which ended earlier this month in Australia, was won by a 19-year-old Brazilian named Filipe Toledo. Four of the final eight contenders were Brazilian.

Brazil has more than 4,000 miles of coastline, and Brazilians have been surfing its waves at least since the Australian surfer Peter Troy gave a demonstration in Rio de Janeiro in 1964. So why the sudden dominance?

The answer is that the country itself has changed. Following the rocky decades of the 1980s and ’90s, when financial shocks and political instability battered the economy and inflation reached peaks of more than 2,000 percent a year, Brazil in the 2000s experienced more than a decade of stability and growth. The abysmal gap between rich and poor narrowed a little, and the middle class ballooned from about 15 percent of the population in the early ’80s to nearly a third by 2012.

What did this have to do with surfing? Everything.

As the sport’s popularity rose in the 1970s and ’80s, Brazilians became serious about surfing, but with a few exceptions they didn’t make it big. A large continental shelf in the Atlantic means that there is not a single first-rate “break” along Brazil’s coastline. To be really good, a Brazilian surfer needs to develop proficiency on more than those gutless waves; he needs the storied breaks of Hawaii, Indonesia or Tahiti, which produce large and powerful surf. For decades, it was the rare Brazilian who could afford to travel to such places.

When Brazilian surfers did travel abroad, they usually went without much support, money or technical assistance. They spoke broken English and had little international experience. And there was a culture clash: They developed a reputation as loud, obnoxious and aggressive, heedless of surfing etiquette. This stereotype (still the subject of heated debate) kept them out of favor with dominant surfers, foreign fans and specialized media.

As a country, too, Brazil played fast and loose with the rules. When the demand for surf gear grew in the ’80s, pirated T-shirts, board shorts and wet suits became ubiquitous. Little was done in Brazil to combat this, leaving some of the most powerful chief executives in the business feeling cheated — and less likely to sponsor a Brazilian surfer.

But today’s generation of Brazilian surfers came up during Brazil’s decade of growth, and they have had support along the way. They’ve been going to places like Hawaii regularly and developing into more complete athletes. Someone like Mr. Medina is very much the face of the new Brazilian middle class. His mother worked as a waitress and a maid, among other jobs; his stepfather, a former triathlete, was his coach. The Medinas lived off the income of a surfing goods store. They were Gabriel’s main source of support — financial, emotional and technical — until he signed his first sponsorship deal at 13.

Mr. Medina’s success will presumably help the next generation of young surfers more easily get sponsors. This would be good for Brazil, but it would also be good for the insular, overwhelmingly white world of professional surfing; Brazilian surfing has brought black faces into the sport’s elite circles.

But Brazil has hit a rough patch. Inflation is back up, the gross domestic product has been middling for years and corruption scandals are rampant. This economic downturn is already hurting Brazilians, and seems to have reached Brazilian surfing as well. Brazil had a national surfing championship called Super Surf, from 2000 to 2009. Over the next few years there were changes in sponsors and in name. By 2014 there was not enough support to stage a national competition, and the national champion was decided merely by adding up the points from state competitions.

Mr. Medina’s victory at the end of 2014 seems to have helped momentarily re-establish the national championship, for a trial period of two years. But no single athlete — or even an entire Brazilian Storm — can counter the overall lack of support for professional athletes (excluding soccer players) that has been endemic to Brazil and that will most likely increase following any serious economic decline.

If the economy does continue to suffer, however, there may be a higher power to which Brazilian surfers can still appeal. In January, the Vatican allowed priests in Rio de Janeiro to gather evidence of the holiness of Guido Schaffer, a popular young priest-in-training and avid surfer who drowned in a surfing accident in 2009. This is an early step in the sainthood process, and Mr. Schaffer, now referred to by locals as the “surfer angel,” has been credited with miraculous deeds. Perhaps preserving the greatness of Brazilian surfing will one day be counted among them.