The procedure will be performed at 7 a.m. ET on Sunday by Marlins physician Dr. Lee Kaplan. Recovery is expected to be four to six weeks, but more will be known after the procedure.
"Stanton is going to have surgery tomorrow," manager Ozzie Guillen announced after the Marlins lost, 3-2, to the Cardinals. "Hopefully, he doesn't lose that many days. I don't know. It's up to how he comes out of the surgery. It might be a month, six weeks. Hopefully it's less."
The setback means Stanton will not participate in Monday's State Farm Home Run Derby and Tuesday's All-Star Game at Kauffman Stadium in Kansas City.
Stanton is the lone Marlins All-Star representative, and general manager Michael Hill said no other Miami player will be sent to Kansas City to take his place.
Washington rookie outfielder Bryce Harper was added to the All-Star team in Stanton's place.
"He was very upfront that he would have loved to represent the National League, but he wants to represent the Marlins first," Hill said.
Saturday was Stanton's first start since Monday at Milwaukee. He tested his knee by doing running and fielding drills at Busch Stadium on Friday afternoon. After his 40-minute session, he was cleared to play on Saturday.
The right fielder was tested right away as Cardinals leadoff batter Rafael Furcal lifted a fly ball that Stanton ran down in right center. Center fielder Justin Ruggiano saw Stanton at full speed, and he got out of the way of the 6-foot-5, 250-pounder.
"I slowed down, I didn't want to run into him," Ruggiano said. "He's like a cartoon character out there. He does everything well. He covers ground, throws. He's got a plus, plus arm.
"We're going to miss him. What's done is done. We just have to make up for his absence with other guys. When he comes back, hopefully, he will help push us towards the playoffs."
In the top of the third inning, Stanton was lifted for pinch-hitter Scott Cousins. The team announced he exited with "right knee discomfort."
An MRI exam taken on Tuesday revealed Stanton has "loose bodies" in the knee. The 22-year-old had opted to play through the discomfort of having bone or cartilage fragments in the knee.
Stanton had one at-bat on Saturday, and he singled to open the second inning. He scored on Ruggiano's home run.
"We're better off that way. That kid, he couldn't do anything," Guillen said. "He said he didn't feel comfortable. He said, 'I can hit, but I can't do nothing else.'
"As soon as he said that, we had to move quickly in a different direction.
Once Stanton left the game, arrangements were made quickly to perform the surgery.
"It was something that you always knew the next time that it flared up that you would do that," Hill said. "You have the days during the All-Star break, where you have the days that he's not missing any games."
One of the strongest players in the game, Stanton was hoping to put on a show in Kansas City. Even though his knee bothered him, Stanton had been hopeful of participating in the State Farm Home Run Derby on Monday at 8 ET on ESPN and at the All-Star Game on Tuesday at 7:30 on FOX at Kauffman Stadium.
In 80 games this season, Stanton is batting .284 with 19 home runs and 50 RBIs. With Sunday being the final game before the All-Star break, the Marlins don't need to add a player. They will do so before they open their second half on Friday at home against the Nationals.
Emilio Bonifacio, on the disabled list since May 20, is expected to be activated by that day.
Bonifacio had surgery to repair a torn ligament in his left thumb on May 25, and he is playing in rehab-assignment games for Class A Jupiter.
"Boni is coming around," Guillen said. "Boni is not Stanton. But we can play a different ballgame. I think everybody has to step it up a notch and try to cover the space left open. We have to do it as a team."
Ruggiano likely will see more time in right field after Bonifacio returns to play center field.
"We have to keep grinding," Ruggiano said. "He's definitely a big bat in the order that we're going to miss. We just have to have other guys step up right now. It's more important for him to come back and play the way he is capable of playing, rather than have him hindered by a bone chip, or whatever it was."