After much speculation and some back and forth between Bayern Munich and Juventus, it would appear that an agreement has been reached for the transfer of winger Douglas Costa.

According to Sport Bild, the transfer fee is 40 million euros and would not immediately be paid in full as it is structured as a loan with an obligation to buy, giving Juventus a few years to pay the full transfer fee. The transfer between both clubs was previously stalled due to a rule in Serie A regarding the amount of EU players on a teams current roster. But with sale of Brazilian keeper Neto to Valencia, a new spot opened up on their roster which Costa can fill.

Costa has had an up and down tenure with Bayern that was ultimately more brief than either side thought when he joined from Shakhtar Donetsk in the summer of 2015 for about 30 million euros. After a solid first season, he struggled to find minutes in his sophomore campaign as his appearances dropped from a total of 43 to 34. This was due in no small part to Bayern finally having a healthy Arjen Robben and Franck Ribery whom Costa could not supplant in Carlo Ancelotti’s starting XI.

While Costa is listed on Bayern’s for Audi Summer Tour in Asia, it is unknown who, if anyone, will take his spot on the roster.