Alvarez led off the inning with a single up the middle, rounded first, and didn't show signs of discomfort until returning back to the bag. Alvarez was grimacing and favoring his right leg before Pirates manager Clint Hurdle and a trainer went out to talk it over.
While the cramping was not considered serious, the Pirates made the decision to replace Alvarez with pinch-runner Eric Fryer for precautionary reasons.
"He was tightening up, so we didn't want to push it," Hurdle said.
Alvarez was 4-for-11 with eight RBIs in the three-game series, and he had singled twice on Sunday before exiting the game.
The Pirates were also without All-Star center fielder Andrew McCutchen, who was selected to the All-Star Game earlier Sunday. McCutchen, who sprained his left wrist on Saturday, is day to day and has missed just four games this season.
Mike Still is an associate reporter for MLB.com. This story was not subject to the approval of Major League Baseball or its clubs.