Antoine Griezmann is set to begin a new chapter at Atletico Madrid.

Barcelona and Atletico reached an agreement shortly before Tuesday’s transfer deadline that sends the French forward back to the Spanish capital on loan for the upcoming season, according to Fabrizio Romano of The Guardian.

The deal apparently includes a buy option worth €40 million to make the move permanent next summer.

Griezmann reportedly agreed to a two-year contract, with an option to extend the deal an additional year, Romano adds.

Anadolu Agency / Anadolu Agency / Getty

The La Liga rivals reportedly initially discussed a swap deal for Griezmann and Atletico Madrid forward Joao Felix. Barcelona failed in their attempt to sign Felix on loan Monday before returning with a new offer involving Griezmann, who enjoyed a successful five-year spell with the Madrid club before moving to the Catalan capital in 2019.

Barcelona spent €120 million to sign Griezmann, but the club shopped him around this summer. Earlier talks with Atletico reportedly broke down over a potential swap deal involving the French forward and midfielder Saul Niguez, according to ESPN’s Sam Marsden and Moises Llorens. Atletico reportedly loaned the Spaniard to Chelsea for €5 million instead.

The 30-year-old Griezmann scored 133 times in 257 appearances at Atletico.