Pepe has been a regular at the back for Real Madrid this season.
The Portugal international has helped the Spanish giants to the top of La Liga with his commanding displays.
He started as Real drew 1-1 with fierce rivals Atletico in the Madrid Derby on Saturday.
However, he was forced off after breaking two ribs in an accidental clash with team-mate Toni Kroos.
Pepe star Real Madrid will miss the showdown with Bayern Munich
Real Madrid transfer odds: Which Premier League aces could move?
Thu, March 30, 2017
Click to reveal the best transfer odds for superstars moving to Real Madrid, courtesy of 888sport
1 of 11
The latest transfer odds for Real Madrid's summer deals, courtesy of 888sport
Pepe broke his ribs during Real Madrid's draw with Atletico
Get Quotes on Home Insurance
Scans revealed he would miss both legs against Bayern, who warmed up for Wednesday's showdown with a 4-1 thumping of Borussia Dortmund.
"After the examinations carried out today on Pepe at the Sanitas La Moraleja University Hospital, he has been diagnosed with fractures in seventh and eighth ribs on the left side," said a club statement.
Pepe's injury now gives Zinedine Zidane a major selection headache.
Real will have just Sergio Ramos and Nacho to call upon as Raphael Varane is sidelined with a hamstring problem.