Marlon Santos will sign for Barcelona on a permanent basis at the end of the season, his agent has said.
Fred Moraes told Radio Barcelona everything was in place for the centre-back to sign from Fluminense at the end of the season.
Marlon joined on a one-year loan deal last July, with the deal including an option to make the move permanent this year.
Earlier this season, ESPN FC reported that Barca would take up that option following the player's impressive performances for the B team and his composed Champions League debut against Celtic.
Moraes said a decision still must be taken on what role the 21-year-old has next season.
"It's been done for a while -- everything is finalised between Barca and Fluminense," he said.
"The next thing now is to speak with the club, with [Barca directors] Andre Cury in Brazil and with Raul Sanllehi, to see what's best for next season.
"The club have already decided [to make the deal permanent], but there's still a decision to be made moving forward."
He said that could either mean Marlon being loaned out or promoted to the first-team picture and added: "Our idea is for Marlon to stay at Barcelona for many years and to continue learning, as he's doing at the moment."
Diario Sport reported that the clause to make Marlon's move permanent stands at around €6 million.
However, Barca will only have to pay Fluminense €2m due to payments they have previously made to the Brazilian club.
They paid €4m to have the first option on Gerson (€3.2m), Kenedy (€400,000) and Marlon (€400,000). Gerson and Kenedy have since gone on to sign for Roma and Chelsea respectively.
Marlon made his La Liga debut at the weekend, playing 90 minutes as Barca beat Las Palmas to keep their titles hops alive going into the final day.