Medical staff taped up the affected area but it quickly became clear the Real captain would be unable to continue and he was replaced by Diego Lopez.
Coach Carlo Ancelotti told reporters that he hoped Casillas would recover in three to four days but Spanish media reported the 32-year-old could be sidelined for two weeks.
"Iker had bad luck, that happens in football," said Real's hat-trick hero Cristiano Ronaldo.
"He did something to his ribs. He was down in the dumps but he will recover soon."
Casillas has barely played since Real and Spain team mate Alvaro Arbeloa accidentally kicked his hand during a King's Cup match in January and broke a bone.
He fell out with former coach Jose Mourinho on his return and was replaced in the team by Lopez.
Mourinho's successor Ancelotti has used Lopez in Real's four La Liga matches this season but picked Casillas, who has retained his place in the Spain team, for their opening Champions League game.
Spain coach Vicente del Bosque has stood by his captain and if fit he will almost certainly be first choice for the final two World Cup qualifiers at home to Belarus and Georgia on October 11 and October 15 respectively.
The world and European champions are level on 14 points with France at the top of Group I and have a game in hand.
Image: Iker Casillas
Photograph: Burak Kara/Getty Images
Coach Ancelotti motivated by Madrid's Champions League record
The Special One hatches plans with 'young' team
WC Qualifier PHOTOS: Ronaldo rescues Portugal, Klose equals record
UEFA Champions League: Ronaldo sparkles in opening night bonanza
Uninspiring Real secure 1-0 victory at Granada