MIAMI -- The second-longest slump in Hanley Ramirez's career ended in dramatic fashion.
Ramirez delivered a two-out walk-off single in the ninth inning that rallied the Marlins to a 3-2 win over the D-backs on Saturday night, snapping Miami's losing streak at six games.
At last, the energized gathering of 33,525 at Marlins Park had something to cheer about.
Ramirez had been in an 0-for-26 rut since he reached on an infield single in the third inning on April 19 against the Cubs, which happened to be the Marlins' last victory.
"It's all about wins," Ramirez said. "We needed that one right there. It's a good win for us. Now we can have our confidence back and come back tomorrow and keep playing hard and have fun."
On a 1-2 offering from side-winding Brad Ziegler, Ramirez laced the winning single to left field. After making contact, Ramirez raised his right hand in triumph, and he spiked his helmet before touching first base and hugging first-base coach Gary Thurman.
"It's a tough time right now, as a team," Ramirez said. "When I was running the bases, I was so emotional for the win. We lost six in a row. At the same time, we're still competing out there."
The late-inning dramatics came on a night Anibal Sanchez struck out a career-high 14 -- which matches the second most in team history -- in a no-decision.
Logan Morrison added an eighth-inning homer to tie it, setting up Miami's last at-bat victory.
Giancarlo Stanton reached on a one-out infield single, and he scored the game-winning run. With two outs, Jose Reyes was intentionally walked to get to Ramirez, whose career long slump is 0-for-29 in 2006.
The intentional walk motivated Ramirez, who made it clear he didn't take exception to Arizona manager Kirk Gibson's decision.
"It has to pump you up," the Miami third baseman said. "I know what they were trying to do, righty on righty. But at the same time, I told myself, 'Shorten your swing down and stay through the middle.'"
The walk-off hit was Ramirez's second of the season, with his first on April 15 against Houston. After delivering the hit, Ramirez pointed in the direction of the fans as he began his celebration.
"I think if we make a good pitch on him, that's fine," Gibson said. "[Ziegler] is much tougher on righties. Right there I felt that Reyes is kind of a slap guy who can run and it gave us a forceout at any base, as well. We just didn't get the pitch where we wanted to, and it didn't work out for us."
Ramirez said he understood Gibson's decision.
"They're trying to do their job," Ramirez said. "Like I say, there is nothing personal in this game. They've got to do whatever they have to do to win the game. At the same time, that's what we expect from ourselves. We keep fighting."
Considering the slump Ramirez was in, Marlins manager Ozzie Guillen said he would likely have made the same decision as Gibson.
"The way Hanley has been swinging the bat right now, and you have first base open, you have a batting title guy [Reyes] at the plate and two outs," Guillen said. "Hanley is struggling right now. I would do the same. I think that's a good move. Thank God it worked for us. But I don't think it was a bad move for them."
Miami's comeback didn't waste a near record-setting performance by Sanchez.
Sanchez's 14 strikeouts ties him for the second most ever by a Marlin. A.J. Burnett twice reached 14 -- on Aug. 29, 2004, while facing Colorado, and on July 6, 2005, against Milwaukee.
Miami's record is 16, set by Ricky Nolasco on Sept. 30, 2009, at Atlanta.
Before his gem on Saturday, Sanchez's previous high was 11, set on Sept. 10, 2011, at Pittsburgh.
The way the game started, it looked like it could be a long night for Sanchez, who gave up two runs in the first inning and he threw 33 pitches. He had 57 pitches through two innings.
"I don't think too much about strikeouts or something like that," Sanchez said. "I saw the screen in the second inning, and I had 57 pitches. I said I had to do something because I don't want to leave the game early. I want to make a good start. I wanted to stay in the game."
A sluggish offense gave Marlins fans little to cheer about, until the late innings.
Blanked by Joe Saunders in a 5-0 loss on Friday night, the Marlins had little success against right-hander Ian Kennedy, who held Miami scoreless until the seventh.
The Marlins' drought of 19 straight scoreless innings was snapped on Reyes' RBI single to right, which scored Omar Infante, who delivered a pinch-hit triple to lead off the inning.
During their losing streak, they managed just six runs in six games, which matched the fewest by the team over any six-game stretch since 1993.
In the eighth inning, Miami tied it at 2 on Morrison's leadoff home run to right field off David Hernandez.
For much of the night, it looked as if Sanchez would become the latest Miami pitcher to come up empty after a brilliant outing.
"Right now, we need to do something to wake up again," Sanchez said. "I know we had a losing streak. We need to wake up and start winning. We have a pretty good team. We need to do something right now."