Diego Costa, the former Chelsea, Arsenal, Wolves and Atletico Madrid striker, has joined Gremio on a free transfer.
The Brazilian left Botafogo in December after only four months with the club.
He went unsigned in January and was connected with Palmeiras, another Brazilian team.
Diego Costa left Botafogo to join Gremio
However, according to Fabrizio Romano, he has reached an agreement with Gremio, which will be his 12th professional club.
Costa is on his fourth team in less than two and a half years, having previously played for Atletico Mineiro and Wolves.
He has only scored 11 goals in 66 games during the last three seasons.
The underwhelming time included one Premier League goal in 25 Wolves appearances.
However, he is still widely regarded for his golden years at the top of European football.
Costa rose to prominence with Atletico Madrid, where he led the club to La Liga success, a Copa del Rey trophy, and a Uefa Super Cup.
They also advanced to the Champions League final, where they lost to Real Madrid.
Chelsea signed him in 2014 for £32 million.
Costa won three trophies during his stay in West London, including two Premier League crowns and a League Cup, while scoring 52 goals in 83 games.
He made two international appearances for Brazil, his home country.
However, he eventually declared for Spain, where he won 24 caps and scored ten goals.