Substitute Rogerio scored a dramatic late winner against Goias to guarantee Sao Paulo a berth in next year's Copa Libertadores.
The 24-year-old, who was introduced in the 89th minute, struck deep into injury time to earn Sao Paulo a 1-0 victory on the final day of Brazil's Serie A season on Sunday, reports Xinhua.
The result secured the fourth spot for Sao Paulo as they ended their campaign two points ahead of Internacional, who won their last match against Cruzeiro 2-0.
Sao Paulo will join champions Corinthians, second-placed Atletico Mineiro, third-placed Gremio and Copa do Brasil winners Palmeiras in South America's top club competition next year.
The match at Goias' Serra Dourada stadium signalled the end of an era for Sao Paulo, who said goodbye to several club idols.
Forty-two-years-old goalkeeper Rogerio Ceni, who missed Sunday's game due to injury, has announced his retirement after 24 seasons, while former Brazil international strikers Luis Fabiano and Alexandre Pato are also leaving the club.
More From This Section
Meanwhile Vasco da Gama were relegated to Serie B after they could manage only a 0-0 draw at Coritiba.
Other demoted teams were Joinville, Goias and Avai.
In other matches on Sunday, Atletico Mineiro beat Chapecoense 3-0, Figueirense overcame Fluminense 1-0, Palmeiras won 2-1 at Flamengo's Maracana stadium, Santos crushed Atletico Paranaense 5-1, Sport defeated Ponte Preta 1-0 and Gremio won 2-0 at Joinville.