Thiago, 29, whose contract with the Champions League winners was due to expire next summer, has agreed a four-year deal at Anfield, where he will wear the No. 6 shirt.
Sources have told ESPN that the fee for Thiago could rise to £25m, based on Liverpool winning the Premier League or Champions League during his time at Anfield. The Spain international will complete a move to Merseyside once he has successfully passed a medical.
"I can confirm that FC Bayern and Liverpool have reached a final agreement," Bayern chairman Karl-Heinz Rummenigge said Thursday, confirming the news. "It was Thiago's big wish to try something new towards the end of his career."
Bayern coach Hansi Flick added: "I can only congratulate [Jurgen] Klopp. He not only gets a top player but also a great person. Today, we are all very sad and it was emotional."
Liverpool manager Klopp had been determined to add the former Barcelona player to his squad this summer, but financial restrictions at the club because of the coronavirus pandemic had left the Anfield hierarchy reluctant to sanction an expensive move for him.
Klopp had been told that a first-team player would have to leave the Premier League champions to create space on the wage bill for Thiago.
But sources have told ESPN that Klopp has now been given the green light to make a move for Thiago without the need to sell a squad player first.
Georginio Wijnaldum, whose contract expires next summer, had been regarded as the most likely departure, with Barcelona coach Ronald Koeman keen to take the midfielder to the Camp Nou. But sources have said Wijnaldum's future will not be affected by any move for Thiago.
Liverpool have faced competition from United for Thiago, who had rejected the offer of a new deal at Bayern to replace his current contract, which expires in June 2021.
United have spoken to the player's representatives, but Thiago's wage demands of more than £200,000 per week have been knocked back by the Old Trafford club.
Bayern have now reluctantly agreed to sell Thiago before the Oct. 5 transfer deadline, however, with Liverpool winning the race for his signature.