MADRID — Luis Suárez is staying in Spain after all.

Barcelona said late Wednesday that it reached a deal with Atlético Madrid for the transfer of the Uruguay striker for 6 million euros ($7 million).

Suárez was let go by Barcelona following six mostly successful seasons in which he won 13 titles with the Catalan club. He leaves as Barcelona’s third highest scorer ever with 198 goals, behind César Rodríguez (232) and Lionel Messi (634).

The 33-year-old Suárez had to find a new club after being told by incoming Barcelona coach Ronald Koeman that he was not in his plans. Koeman was asked to revamp the Barcelona squad after the embarrassing 8-2 loss to Bayern Munich in the quarterfinals of the Champions League in August. Midfielder Ivan Rakitic already left for Sevilla after also being told he wasn’t wanted anymore, and defender Samuel Umtiti is also expected to leave.

Messi, Suárez’s longtime friend and teammate, wanted to leave but will stay after the club denied his request for a free transfer at the end of last season.

Barcelona said it wanted to publicly express its “gratitude to Luis Suárez for his commitment and dedication,” and wished him “all the best for the future.”

The club said Suárez will give a news conference on Thursday. He reportedly bid farewell to his teammates earlier Wednesday.

Spanish media said Barcelona had initially made an agreement with Suárez to allow him to leave for free, but later backtracked after it became known that he wanted to go to rival Atlético. Suárez's lawyers had been negotiating with the Catalan club since Tuesday to try to make his move to Atlético possible.

Suárez, who arrived in Barcelona from Liverpool in 2014, will be joining Atlético’s Argentine coach Diego Simeone, who has always praised Suárez and is also known to carry the same hard-working, never-give-up attitude as the Uruguayan striker.

Suárez had initially looked set to join Juventus in Italy, and had even taken a test to receive a European passport that could help him complete the move. But the deal fell through because the passport process reportedly would take too long, and Juventus decided to go after Atlético’s Álvaro Morata, opening space for Suárez in Simeone’s squad.

Simeone still has Diego Costa and João Félix as its main attackers, but the duo only scored 14 goals combined for Atlético last season, seven fewer than Suárez scored for Barcelona.

The Catalan club had already added young Portugal forward Francisco Trincão this season. It still has Antoine Griezmann, Ousmane Dembélé and youngster Ansu Fati, who on Wednesday was officially added to the first team and had his buyout clause increased from 170 million euros ($199 million) to 400 million euros ($469 million). Martin Braithwaite also is an option for Koeman up front, and the club reportedly was looking to eventually sign forwards Memphis Depay and Lautaro Martínez.

Atlético will make its Spanish league debut on Sunday against Granada at the Wanda Metropolitano Stadium. Atlético’s first two games were postponed because it played late into last season in the quarterfinals of the Champions League.

___

More AP soccer: https://apnews.com/Soccer and https://twitter.com/AP_Sports

___

Tales Azzoni on Twitter: http://twitter.com/tazzoni