Mark Melancon earned his second save of the season. Mike Zunino delivered a pinch-hit single and Nick Franklin singled to put a pair of runners on with two outs in the ninth, but Kyle Seager grounded out.
Vin Mazzaro (4-2) picked up the victory with two innings of scoreless relief.
Hernandez bounced back to form after his worst start of the season. He blew a seven-run lead against the Los Angeles Angels in his last appearance, but struck out 11 against the Pirates. Hernandez gave up six hits and walked two.
“You’ve just got to battle him. You’ve got to battle him and try and get his pitch count up and stay in the game so you can get him out before it’s the ninth inning,” Hurdle said. “We were able to do that. He’s always going to be tough. He competes very, very well out there and the sequence and the stuff he has makes it a very difficult day at the plate.”
The Mariners squandered a chance to take the lead in the eighth. With the game even, Kendrys Morales doubled and the Pirates intentionally walked Ibanez to put a pair of runners on with one out. Mazzaro managed to escaped by striking out Justin Smoak and getting Michael Saunders to fly out.
“We’ve got to hit. It’s time to hit,” Mariners manager Eric Wedge said. “You’re not going to win games unless you hit. They got the two-out hit. We didn’t. Game over. That’s the difference.”
Walker hit his sixth home run, connecting with two outs.
Seattle managed to get a run back in the bottom half without a hit. Ibanez reached first after swinging at a third strike wild pitch that got away from catcher Russell Martin, then Smoak hit a grounder and Mercer mishandled the throw to second, the ball deflecting off the shortstop’s glove.