RIO DE JANEIRO — Brazil’s list of feats since ending authoritarian rule in the 1980s is as long as it is varied, including antipoverty programs pulling millions into the middle class, the democratic election of presidents who suffered indignities under the dictatorship and the surging growth of tropical agriculture to help feed the world.

But instead of coming together to extol such triumphs on the global stage as the host of the World Cup, the soccer tournament starting on Thursday with teams from 32 countries, Brazil is marked by rifts, with some people genuinely excited about the event while others are simmering with resentment over its ballooning costs and a sluggish post-boom economy.

While thousands poured into the streets in 2007 to celebrate Brazil’s winning bid to host the World Cup, bitter strikes are now roiling major cities. In São Paulo, where the opening match between Brazil and Croatia is just days away, riot police officers on Monday used tear gas to disperse striking subway workers. Brazilian legends of the sport, from Ronaldo to Romário, are voicing shame and disgust over troubled preparations in the nation that has won the World Cup five times, more than any other country.