The 22-year-old was forced off after 53 minutes of Switzerland's FIFA World Cup qualifying clash with Albania on Friday, which the Swiss won 2-1 to seal their place at Brazil 2014.
He returned to Germany for tests and is now set for a spell on the sidelines, to his great frustration.
He told Bayern's official website: "The diagnosis is bitter. I'm disappointed, but I will try to be fit again as fast as possible.
"I have had this injury before in the left hamstring. On that occasion I recovered relatively quickly. I hope I will again.
"I had a super week. First, our strong performance in Leverkusen, as the coach (Pep Guardiola) played me from the beginning, and then the World Cup qualifiers with Switzerland.
"I was in good shape. And now, it's a pity. But I am already looking forward. I'll be back soon."
Shaqiri has made 12 appearances for Bayern in all competitions this season, scoring twice.
Get the best features, fun and footballing frolics straight to your inbox every week.
Thank you for signing up to Four Four Two. You will receive a verification email shortly.
There was a problem. Please refresh the page and try again.