The game at the Santiago Bernabeu Stadium in Madrid ended in a 1-1 draw, but the former England skipper eventually limped off the field in the second half, in noticeable discomfort.
He now faces around a month on the sidelines if the initial diagnosis of an injury to the internal lateral ligament in his right knee is confirmed.
Beckham was hurt when he collided with advertising signs behind the goal after running to hit a cross into the goal area. The injury could impact his move to Major League Soccer in America this summer.
The 31-year-old English football star had been in impressive form since being recalled to the Real Madrid starting line-up a month ago.
In January, he signed a multimillion-dollar contract to play soccer for the Los Angeles Galaxy team. There were also calls for him to be brought back to the English national team.
Not everyone favours his move to America though. Former England striker Gary Lineker has said it could signal an end to Beckham's career in England, and compared the move to going into semi-retirement. Beckham's contract with Real Madrid ends on June 30 and he is expected to join the Galaxy sometime in July.
Photograph: Denis Doyle/Getty Images