Weir, 28, picked up the injury in the first half of Scotland's 1-1 UEFA Nations League draw with Belgium on Tuesday, and was substituted in the 20th minute.
"Following tests carried out on our player Caroline Weir by the Real Madrid Medical Services, she has been diagnosed with a ruptured anterior cruciate ligament in her left knee," the club said in a statement. "She will undergo surgery in the coming days."
The injury is a blow for Real Madrid, just one game into the new Liga F season.
Weir has starred for Madrid since joining from Manchester City in July 2022, scoring 28 goals in all competitions last season including 19 in the league and six in the Women's Champions League.
Those goals helped Madrid finish second in Liga F and reach the Copa de la Reina final, although they were eliminated from the Champions League at the group stage.
Weir started Madrid's only competitive game of 2023-24 so far -- after the start of Liga F was delayed by a week due to a players' strike over pay and conditions -- in a 2-0 win at Valencia on Sept. 15.