Marlins right-hander Dan Straily hit Longoria in the fourth inning. Longoria stayed in the game briefly to run before being replaced in the field.
Manager Bruce Bochy made the announcement on the injury after his team’s 6-3, 16-inning win.
“That’s a tough break for us,” said Bochy, who added that Longoria will get a second opinion when the team returns to San Francisco.
It’s the same injury teammate Madison Bumgarner suffered during spring training. He returned to the rotation June 5.
Longoria is hitting .246 with 10 home runs and 34 RBIs in his first season with the Giants.