He did so by going yard in the fifth inning of the Giants' 10-1 win against the Mariners Wednesday at AT&T Park in San Francisco.
Before the game, he told teammates that he would hit a homer off of the former Cy Young Award winner.
The Giants began the bottom of the fifth frame with a home run from Brandon Belt. McCutchen and Buster Posey both drew walks before Sandoval stepped into the box. The Mariners ace tossed in a called strike and threw a ball before fooling Sandoval with a 78.6-mph changeup to get ahead in the count. Sandoval fouled off three pitches and received two more balls before Hernandez's 10th offering of the at-bat.
Hernandez heaved in an 86.7-mph slider on the 10th pitch and Sandoval did not miss it.
He swatted the pitch deep to right field, over the stands and into the bay for a three-run shot. Panda's bomb put the Giants up 8-0.
"I was telling the guys I faced Felix before. I had a feeling that we were going to come to the field to do some damage today, as a team and as an offense," Sandoval said.
The Mariners replaced Hernandez with James Pazos after Sandoval's at-bat. Brandon Crawford hit a solo shot on Pazos's third pitch of the day.
Seattle scored its lone run on a Daniel Vogelbach double in the sixth inning, before the Giants got another run in the seventh frame from a Belt RBI single.
Sandoval was 1-for-4 with four RBIs, a walk, a run scored and a strikeout Wednesday for the Giants. He is now hitting .333 on the season.
"His role is going to be what has happened so far," Giants manager Bruce Bochy told reporters after the game. "He's a guy that's going to be an important pinch hitter for us, probably more late in the game. I'm not afraid to pinch hit him right-handed either. It's nice to have a switch hitter you can put up there if they make a change."