Gnabry initially impressed after his 2016 move from Arsenal, making his Germany debut, but eventually became a peripheral figure under Alexander Nouri and started just one Bundesliga game in the final two months of the campaign.
It was a real coup for a Bremen side who have struggled in the Bundesliga in recent years, and there were persistent rumours at the time that Bayern had contributed in some way to the transfer with the hope of acquiring the midfielder in the future.More news: Masters de Montreux: Las Panteras perdieron con China y finalizaron cuartas
In the summer, he moved to Werder Bremen where he excelled.
Bayern says the 21-year-old Gnabry, who told Bremen last week that he wanted to leave, will sign a three-year contract with the German champion.
Klaus Filbry accused him of opting for the "easy choice".
Bayern chairman Karl-Heinz Rummenigge added: "We're pleased that in Serge Gnabry another young German worldwide is coming to FC Bayern". I think it's a pity, but I wish him all the best. "It's going to be an exciting time and one that I'm very much looking forward to", said the former Arsenal man Gnabry.