Torres set for six weeks out
"Fernando saw a specialist in Spain earlier today and it was decided that he would need surgery on a torn cartilage in his right knee," a Liverpool spokesman told the official Liverpool website.
"This will be carried out later tonight. We cannot comment ahead of the operation but, as a guide, the usual rehabilitation period for this type of procedure is around six weeks."
European champions Spain play their opening World Cup match against Switzerland on June 16. They are also grouped with Chile and Honduras in Group H at the tournament which opens in South Africa on June 11.
Torres, 26, who has scored 22 goals in all competitions this season, was sidelined for a month after a knee operation in January. He had struggled with a groin injury at the end of last year.
He will miss the remainder of the Premier League season and Liverpool's Europa League semi-final against his old club Atletico Madrid.