The 30-year-old, who only had a year remaining on his contract at Anfield, leaves after six wildly-successful years on Merseyside to join the German champions on a long-term deal.
After two failed approaches a deal, which will see Bayern pay £27.5m up front with a further £5m due when the Senegal international meets specified appearance clauses and an additional £2.6m based on individual and team achievements, has been agreed.
Bayern believed they could secure Mane on the cheap with an opening offer of £21.4m plus £4.2m in add-ons, based on individual and team achievements which the Reds considered improbable.
A subsequent bid was rejected but a compromise was reached on Friday which is likely to see Mane replace Robert Lewandowski, who has expressed a desire to leave.
Mane scored 120 goals in 269 appearances across six seasons at Anfield and won the Premier League, Champions League, Fifa Club World Cup, European Super Cup, FA Cup and League Cup.