Bastian Schweinsteiger said: "I have thoroughly enjoyed my time at Bayern Munich, it has been an incredible journey and I didn’t take the decision to leave lightly. Manchester United is the only club that I would have left Munich for. I feel ready for this new and exciting challenge in what I regard as the most competitive league in the world and I am looking forward to working with Louis van Gaal again.
"I will never forget my time at Bayern Munich and I would like to thank everyone at the club and the fans for the great memories."
Louis van Gaal said: "Bastian is, of course, no stranger to me. I worked with him during my time at Bayern Munich and I am truly delighted he is joining Manchester United. His record speaks for itself; he has won every honour at club level and was a major part of the successful Germany World Cup-winning team last summer.
"Bastian is the ultimate professional and there is no doubting his talent and his ability to control games. He brings a wealth of experience and is an excellent addition to our squad."