Tottenham were rumored to be interested but Marcel Sabitzer leaving for Bundesliga rivals Bayern Munich on Monday opened the door for Leipzig's new arrival.
Moriba was unable to negotiate new terms with Barca over his contract, which was due to expire at the end of the 2021-22 season.
Barca president Joan Laporta said Moriba would not feature for the first team if he did not commit his future and Leipzig have taken advantage of the situation to get the player to Germany.
"I'm very happy that my move to RB Leipzig worked out - an exciting club that has always had an offensive style of play and therefore fits my game very well," Moriba, who has signed a five-year deal, told his new club's website.
"I am convinced that Leipzig is the ideal next step for my career and further development - that was ultimately the reason for my decision to change.
"My whole concentration is now fully on arriving at the club, in the team and in the city, in order to then perform on the pitch as quickly as possible. We have ambitious goals for this season and I can hardly wait for the challenge."
Moriba broke into Ronald Koeman's plans last term, making 18 appearances across all competitions, providing two assists and scoring his sole senior goal against Osasuna.
His finish against Osasuna made him the youngest player to score from outside the box in LaLiga last season, while his debut assist made him the youngest to do so in the competition this century.
The 18-year-old averaged 3.2 dribbles per 90 minutes, a total bettered by only four team-mates, completing 2.8 of those to achieve a success rate of 89.3 per cent.
Despite the limited sample size, Miralem Pjanic was the only team-mate to boast a more successful record of those to attempt more than one dribble per 90 minutes.
In March, Moriba was also rewarded with his Champions League debut, appearing as a late substitute against Paris Saint-Germain.
Barca confirmed the sum received, as well as revealing a further €6m could be due if certain variables are met. They will also get 10 per cent of any future sale, should the teenager move on from Leipzig.