Brazil's Supreme Court finally named Sport Recife the winner of the 1987 league title on Tuesday.
Sport -- a team that more often fights against relegation than for titles -- beat Rio de Janeiro giants Flamengo 3-1 in the ruling by a five-member panel.
One member of the panel abstained because his son had worked as a Flamengo attorney in the case.
The long-running dispute began when Flamengo won the title in a league created by the clubs involved. However, Brazil's football confederation decided to organise a separate competition, which was won by Sport. The confederation then tried to get Flamengo to play Sport in a final, an offer that the Rio giants rejected.
Had the panel failed to decide, the case would have gone to the full 11-member Supreme Court.
"Football is passion, but the ideal is that sporting decisions do not come to court," Justice Rosa Maria Weber said.
- Sport Club do Recife (@sportrecife) April 18, 2017
Brazil's Supreme Court is currently clogged with dozens of investigations into public officials in a sprawling corruption scandal involving state-run oil company Petrobras and major conglomerate Odebrecht, among others.
Justice Marco Aurelio Mello, a Flamengo fan that ruled against his club, said there will be no more appeals in the affair. "This will be the final score," Mello said during the session.
Also a Flamengo fan, Justice Luis Roberto Barroso said: "There is no place worse than the judicial system to discuss sports." He voted to split the title between the two clubs.
After the decision, Barroso said "40 million fans have their hearts shattered." Justice Mello added: "And that includes me."
No campo, na bola, sempre Flamengo. Campeão Brasileiro de 1987. pic.twitter.com/hX53sy0fyJ
- Flamengo (@Flamengo) April 18, 2017
Flamengo, the most popular team in Brazil, have always claimed the title and are unlikely to be swayed by the high-court ruling. But seconds after the decision, Sport Recife proudly announced the title on its website.
"[The title of] 87 is, undoubtedly, ours," Sport Recife said. "In court, once more, Sport beat those who ran away."
Flamengo used Twitter to answer Sport's comment. "On the pitch, on the ball, always Flamengo. Brazilian champion of 1987."
Brazil's football confederation did not comment on the ruling.