The Portugal international was replaced during the first half of Real's 4-1 win at Alaves on Saturday.
"After tests carried out today on Pepe, he has been diagnosed with a grade 2 muscle injury in the femoral biceps of his left leg. His recovery will continue to be monitored," Real said in a statement on Monday.
The 33-year-old centre back, who has started eight games in all competitions for Real this season, is unlikely to return before December, ruling him out of six games, including the city derby at Atletico Madrid on Nov. 19.
He will also miss Portugal's World Cup qualifier at home to Latvia.
News that makes sense
Your trusted source for staying up-to-date with the world around you. Get free daily news updates and analysis, straight to your inbox.
La Liga leaders Real play travel to Legia Warsaw in the Champions League on Wednesday. They visit arch-rivals Barcelona in the first Clasico of the season on Dec. 4.
(Reporting by Adriana Garcia, editing by Ed Osmond)
