The 26-year-old was in Barcelona's youth academy between 2007 and 2014 before leaving for Dinamo Zagreb, but he has now sealed a return to the Catalan giants.
Olmo is believed to have cost Barcelona in the region of €60m (£51.4m), including add-ons, while his release clause has been set at €500m (£429m).
"FC Barcelona and RB Leipzig have reached an agreement for the transfer of Dani Olmo," read a statement from the La Liga giants. "The player will sign a contract with the club for the next six seasons, until 30 June 2030, and his buyout clause is set at €500m."
Barcelona have also confirmed that Olmo will wear the number 20 shirt for his new club, and he is set to be officially presented as the club's second signing of the summer on Monday.
Olmo opens up on "dream" return
"I'm very happy, it's a dream come true, I'm returning home with my family and with my teammates," Olmo told Barcelona's official media after confirmation of the move.
"I'm looking forward to getting started, I'm very proud that Barca has made this effort, that they want me.
"The objective is to win, we are Barca and we have to compete for everything, we have a team, we have players, we have staff and we are going to go for everything."
Olmo had injury problems for Leipzig during the 2023-24 campaign but still managed to score eight goals and register five assists in 25 appearances for the club.
The forward has left Leipzig with a record of 29 goals and 34 assists in 148 appearances in all competitions, including 17 goals and 24 assists in 107 league fixtures.
Will Barcelona still sign Williams?
Nico Williams had been Barcelona's leading transfer target this summer, but the deal has recently stalled, with Olmo becoming the main beneficiary of the situation.
Olmo was excellent for Spain at Euro 2024, scoring three goals and registering two assists in six appearances at the competition, playing a leading role in his country winning the tournament.
The same can also be said for Williams, but it now appears likely that the forward will be staying with Athletic Bilbao for at least another season.
A recent report claimed that Barcelona will not give up on a deal for Williams and can indeed afford to sign both the Athletic winger and Olmo during the summer market.
However, Hansi Flick's side may be forced to look elsewhere if they wish to bring in another forward, with Bayern Munich's Kingsley Coman thought to be a potential loan target.