MIAMI (AP) -- Ricky Nolasco followed his worst outing of the season with his best.
It resulted in a rare win for the Miami Marlins.
Nolasco struck out 11 and the Marlins stopped a season-high seven-game losing streak, holding off the Arizona Diamondbacks 2-1 Sunday.
''We've been playing close games, but it doesn't matter if you lose 10-0 or 2-1, you don't want to lose so it was good to snap that and try to get on a roll here,'' Nolasco said.
The Diamondbacks scored once in the ninth. Mike Dunn, the Marlins' third pitcher of the inning, got pinch-hitter A.J. Pollock to ground out on a 3-2 pitch with the bases loaded to end it.
''Bend, but don't break, that's all that matters,'' Nolasco said.
Marcell Ozuna broke a scoreless tie with a two-run double in the sixth.
Didi Gregorius had three hits for Arizona, which had won four in a row.
''Early in the game we had a few chances, but we couldn't get the big hit when we needed it and (Nolasco) got stronger,'' Gregorius said.
Nolasco (3-5) was coming off an outing in which he allowed six runs in five innings in a loss to Cincinnati on Tuesday.
''Ricky was great,'' Marlins manager Mike Redmond said. ''Coming off a shaky last start, but that's Ricky. Ricky's been solid all year and I really wanted him to finish that game. He looked good and was in complete control.''
But the Marlins' all-time wins leader bounced back with his best, earning his 79th career victory. He gave up one run and five hits in eight-plus innings.
''I felt good, good command of all my pitches,'' Nolasco said. ''The curve ball was really good so that really helped a lot. I was able to spin it pretty much whenever I wanted to.''
After hitting Cody Ross with a pitch in the fourth, Nolasco retired the next 14 batters, striking out the side in the fifth and again in the eighth.
Gregorius led off the ninth with a double, finishing Nolasco's day after 110 pitches, 74 for strikes.
Closer Steve Cishek relieved got Paul Goldschmidt to ground out as second baseman Derek Dietrich made a backhanded play up the middle. Jason Kubel hit a sacrifice fly that made it 2-1.
''That was a huge play in the hole,'' Redmond said.
After Eric Chavez followed with a pinch-hit single and Martin Prado walked, Dunn came in and walked Miguel Montero to load the bases. Dunn retired Pollock for his second career save.
''We had a good finish and I thought we were in good shape with A.J. (Pollock) there,'' Diamondbacks manager Kirk Gibson said. ''It just didn't work out.''
Wade Miley (3-3) gave up two runs and five hits in six innings while striking out six. He is 2-1 with a 0.89 ERA in three career starts against the Marlins.
''I felt good out there,'' Miley said. ''I was making pitches and throwing strikes. Just a couple of bad pitches cost you late in the game, especially in a game like that where it's 0-0. You've got to do better job.''
With the game scoreless until the sixth, Adeiny Hechavarria and Dietrich singled and Ozuna hit a double off the left-center field wall near the 386-foot sign. It snapped a scoreless inning streak for the Marlins at 14 after Brandon McCarthy tossed a three-hit shutout on Saturday in a 1-0 win.
''I thought it was a home run, but it's OK, a double, I'll take it,'' Ozuna said.
Ozuna, a 22-year-old rookie outfielder, is hitting .295 since being called up on April 30.
After getting nine runs on 16 hits in a series-opening 9-2 win on Friday, Arizona scored just two runs on 10 hits in the final two games.
''We got beat around a little bit, but we were able to pitch some really nice games the last couple of days,'' Redmond said.
NOTES: Arizona pulled off a rare 2-1 putout in eighth when Hechavarria popped up a bunt that bounced off catcher Montero's glove and then corralled by pitcher Josh Collmenter after he bobbled it with his barehand. ... Nolasco's career high for strikeouts in a game is 16 at Atlanta on Sept. 30, 2009. ... Arizona continues its road trip at Colorado on Monday as LHP Patrick Corbin (6-1, 1.52 ERA) faces RHP Jon Garland (3-4, 4.89 ERA). Miami will start RHP Alex Sanabia (2-6, 5.00 ERA) at home against Philadelphia LHP Cole Hamels (1-6, 4.61 ERA).