Sao Paulo (AFP) – In a last-minute ruling, a Brazilian court overturned an earlier decision and allowed a league match featuring top club Flamengo to go ahead Sunday, despite 19 players testing positive for coronavirus.

The ruling, which came 10 minutes before kickoff, was the latest twist in a dramatic saga around the match between Rio de Janeiro-based Flamengo, the reigning Brazilian league and South American champions, and Sao Paulo side Palmeiras.

Despite being forced to call up a raft of emergency substitutes from their under-20 side, Flamengo managed to hold their rivals to a 1-1 draw.

The match almost didn’t happen.

On Saturday, the labor court for the state of Rio de Janeiro suspended the fixture, ruling it was impossible to guarantee that more Flamengo players and staff were not infected.

But the Brazilian Football Confederation appealed, arguing the outbreak at Flamengo was “an isolated incident that cannot be attributed to the Brazilian Football Championship.”

Federal labor judge Vieira de Mello Filho ruled the Rio de Janeiro court had “exceeded the limits of its jurisdiction,” given that the match was being played in Sao Paulo.

Both clubs had already headed to the stadium in case the match went ahead.

Flamengo, Brazil’s wealthiest club, had joined far-right President Jair Bolsonaro in pushing for the resumption of play after football was suspended for the pandemic.

But when hit by a massive outbreak of Covid-19, they changed their tune, seeking to have the Palmeiras match postponed.

Flamengo were already forced to use multiple substitutes at their last match, against Ecuadoran club Barcelona Tuesday for the Copa Libertadores, after seven players tested positive for the virus, where the Brazilian club nevertheless won 2-1.

They faced a flurry of criticism when pictures emerged showing players socializing onboard the club plane without face masks, even as more positive test results rolled in.

In addition to the 19 infected players, 17 Flamengo employees have tested positive, including Spanish coach Domenec Torrent and the club’s president, Rodolfo Landim.

Brazil has the second-highest death toll in the pandemic, after the United States, with more than 140,000 people killed and 4.7 million infected.

Football returned to Brazil in June with closed-door matches after a three-month hiatus for the pandemic, the first South American country to resume play.