Inter reached an agreement with Bayern to sign Sommer for a reported €6 million and he underwent a medical in Milan on Monday before putting pen to paper on his new contract with the Nerazzurri.
Sommer leaves Germany having played 291 matches throughout the course of his career in the Bundesliga.
"We understand and respect Yann Sommer's desire to seek a new challenge at Inter Milan because he wants to play as the number one goalkeeper in the long term," FC Bayern CEO Jan-Christian Dreesen said. "Yann Sommer helped us out in a complicated situation when Manuel Neuer was seriously injured and we would like to thank him sincerely for his commitment.
"We wish him all the best and every success for the future."
Sommer has made 83 appearances for his country, including three at the 2022 World Cup in Qatar, since making his debut in 2012. He joins an Inter side that will play in the Champions League having finished third in Serie A last season and losing 1-0 to Manchester City in the UCL final in June.