The Reds will receive 32m euros (£27.4m) with an additional 6m euros based on appearances, plus 3m euros for individual and team achievements.
Liverpool turned down two bids from Bayern before agreeing a fee for the Senegal forward, who was under contract until next summer.
READ MORE: South Africa: Dreams Talks With Michelle Mathews, Director at Viridian
Mane joined Liverpool for £34m from Southampton in June 2016, and scored 120 goals in 269 games, finishing last season with 23 goals in all competitions.
Bayern president Herbert Hainer said to the media.
READ MORE: African Development Bank to invest €10 million in reinsurance firm CICA-Re
“Sadio Mane is a world star who underscores the appeal of FC Bayern and increases the attractiveness of the entire Bundesliga, It is for such unique footballers that the fans come to the stadiums.”
Mane helped Liverpool win the Champions League and the Premier League, and in February scored the winning penalty as Senegal won the Africa Cup of Nations for the first time.
In a farewell interview for the Liverpool website, Mane said: “It is really strange to no longer be a Liverpool player but I had an unbelievable time. I am going to be Liverpool’s number one fan forever.”