RB Leipzig reach €20m agreement for Barcelona teenager Ilaix Moriba - sources

Why RB Leipzig move makes sense for Barca starlet Moriba (1:27)

Gab Marcotti and Julien Laurens discuss Barcelona youngster Ilaix Moriba's proposed move from Barcelona to RB Leipzig. (1:27)

RB Leipzig have reached an agreement with Barcelona to sign midfielder Ilaix Moriba for a fee which could reach €20 million ($27.5m), sources have confirmed to ESPN.

Ilaix, 18, will fly to Germany to complete a medical ahead of signing a five-year contract with the Bundesliga side before Tuesday's transfer deadline.

Barca had hoped to tie Ilaix down to a new contract, with his deal due to expire next year, but negotiations with his agents failed to yield an agreement this summer.

- Stream ESPN FC Daily on ESPN+ (U.S. only)
- Don't have ESPN? Get instant access

With neither party willing to budge from their initial position, Barca sent the youngster to train with the B team during preseason.

Sources told ESPN in August that the Catalan club were willing to let Ilaix leave but only in the event a club were willing to match their asking price.

In the event that no club met Barca's demands, Ilaix risked being left in the stands for the season, training for the youth team and playing no competitive football. He could then have left for free in 2022.

However, after failing with an opening bid of around €6m, Leipzig returned to the negotiating table over the weekend and a final agreement was reached with Barca on Monday.

Sources have told ESPN the initial fee is worth around €15m but the transfer could end up costing the German club as much as €20m if a series of add-ons are met.

Ilaix first joined Barca in 2010 from rivals Espanyol and progressed through the club's La Masia youth academy, eventually making his first team debut earlier this year under Ronald Koeman.

He ended last season having made 18 appearances for Barca and scoring one goal, in the LaLiga win over Osasuna in March.

Koeman had hoped to keep Ilaix in the first team this season, with Barca rebuilding the side following the departure of Lionel Messi, and said recently he was disappointed the player and his representatives had decided to look elsewhere.

"I think his situation is horrible," Koeman said on Aug. 20. "He is a young player, 18. He has had the chance to play for the first team. He is the future of this club... and he is in a situation where he's not playing, not with us.

"I know what the club want to offer him. My advice to him is that money is not the most important thing. It is about playing games. But the player and his agents have decided differently. I am disappointed."

Earlier on Monday, Leipzig had confirmed that midfielder Marcel Sabitzer had left the club after six years to join previous coach Julian Nagelsmann at Bayern Munich.