The German club said the 40-year-old Kompany was observing a training session for the reserves team when the incident occurred on Friday (local time).
"Kompany will undergo comprehensive examinations at the hospital and remain under medical care," the team stated. "In the meantime, his coaching staff will manage training and match-related activities."
Board member for sport Max Eberl said Kompany, one of global soccer's leading younger coaches, will be given "all the time he needs" to recover as Bayern prepare to play Freiburg in the Bundesliga on Sunday.
"Vincent Kompany's health is our top priority," Eberl said. "We at FC Bayern will do everything we can to ensure that he recovers quickly. Vinnie will receive all the necessary medical care and support, as well as all the time he needs."
Kompany had been dealing with a viral infection since last week, and his assistant Aaron Danks said on Tuesday it affected the Belgian's legs.
The usually animated Kompany remained seated throughout Bayern's 6-1 win over Leipzig last week, then missed a training session and a pre-game news conference on Tuesday, when Danks said he needed time to rest at home.
However, Kompany returned to the dugout for Wednesday's 2-2 draw against Arsenal in the Champions League.
After that match, he acknowledged he tried to push through the illness and failed to heed the signals from his body.
Kompany joined Bayern in 2024 from Burnley and has won the German league twice since then. The team also reached the Champions League semi-finals and won the German Cup last season.
Among a raft of teams wishing Kompany well was Manchester City, where he was the long-time captain and won the Premier League four times.
"Everyone at Manchester City is wishing a speedy recovery to our former captain and Club legend, Vincent Kompany," City posted on X. "Get well soon, Vinny."