Pepe opened the scoring with a towering header seven minutes into the second half but then had to be replaced after clashing with teammate Toni Kroos.
Griezmann halts Real Madrid's title charge
"He has been diagnosed with a fracture in the seventh and eighth left ribs," Madrid said in a statement.
The Portuguese defender is expected to be sidelined for up to a month.
Madrid are already set to miss central defender Raphael Varane for the rest of the month due to a hamstring injury.
Morata’s hat-trick leads Ronaldo-less Real to crucial victory
The European champions face Bayern in the first leg of their Champions League quarter-final on Wednesday.
Bayern then travel to the Spanish capital for the second leg on April 18 before Real host Barca in a potential La Liga title decider on April 23.
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ