Cody Ross' three-run pinch-hit home run in the eighth inning spoiled Fernandez's outing, and the Diamondbacks held off the Marlins 3-1 on Wednesday to take two of three in the series.
Fernandez (4-4) retired 14 in a row before walking two of the three batters he faced in the eighth. He was relieved by left-hander Mike Dunn, who gave up the home run to Ross on a 1-2 pitch.
Fernandez, from Cuba, might have had his best start yet.
"He's a monster out there, man," Miami manager Mike Redmond said. "He's 20 years old and this kid, he brings it every time. He brings it every five days. It's fun to watch him — frustrating that we couldn't get him a couple of runs and win that ballgame because he throws it out there every time. He's fun to watch and he's special, special."
Arizona starter Trevor Cahill left after a line drive bruised his right hip in the first. Josh Collmenter allowed one hit in six innings of relief, the latest in a series of his effective long-inning relief outings.
Cahill said he thought he could have stayed in and pushed through the injury but the decision was made to play it safe.
Justin Ruggiano hit a home run off Heath Bell to start the ninth.
Bell flirted with bigger trouble before recording his 13th save in 15 tries.
After Ruggiano's homer, Ed Lucas singled to bring up Giancarlo Stanton, whose home run off Bell on Friday gave Miami a 3-2 victory. Stanton walked on five pitches to put runners on first and second with no outs.
Bell got Marcell Ozuna on a flyout, catcher Miguel Montero made a nice sliding catch of Derek Dietrich's foul to the screen and pinch-hitter Logan Morrison struck out to give Arizona two of three against Miami.
David Hernandez (4-4) pitched a scoreless eighth to get the victory.
Fernandez, a first-round draft pick in 2011, was charged with two runs on three hits with four strikeouts and those two costly late walks in 7 1-3 innings.
"This kid's impressive. He's got really good stuff. I think he's got Cy Young stuff in the future," Montero said. "I see him as a Cy Young in the near future because he's got all his pitches. He's that good."
Dunn said Fernandez deserved a better outcome.
"The team went out there and battled all game today," Dunn said. "Fernandez pitched his butt off, did a great job and on one pitch it's like we throw the whole outing away that he just had."
Collmenter, who throws with an unorthodox overhand style, struck out seven and walked one and Redmond wondered why the Marlins couldn't hit him.
"It looked to me like he was throwing some pretty good pitches to hit," Redmond said. "He did throw a few change ups. That's his pitch, but I was surprised he shut us down that many innings."
Collmenter retired 13 in a row, striking out the side in the fourth, before Stanton singled to start the seventh. Stanton was stranded when Ozuna struck out, Dietrich popped out and Adieny Hechavarria flied out.
After Collmenter's infield single to lead off the third, Fernandez didn't allow another runner until Jason Kubel drew a leadoff walk on a 3-2 pitch in the eighth. A.J. Pollock popped to the catcher on a foul trying to advance the runner with a bunt, then Didi Gregorius walked to put runners at first and second with one out.
That ended Fernandez's outing and the young pitcher wasn't too happy with that final ball four call.
"The last pitch was a little close," he said, "but I'm not an umpire, I'm a pitcher. If that was a ball then I've got to agree with it and that's how it goes. It could go both ways but it's not my call and there's nothing I can do about it."
Initially, left-handed batter Alex Hinske was announced as the pinch-hitter. But when the left-handed Dunn came on, manager Kirk Gibson switched to Ross, who is hitting .387 against lefties.
Cahill, who had lost his previous three starts, took a lined shot off his right hip off the bat of Ozuna. The ball careened off Cahill to third baseman Martin Prado, who threw the runner out to end the inning. Cahill came out for the second inning and had a 2-1 count on Dietrich when the trainer came out and, after some discussion, the pitcher left the game.
NOTES: Arizona's Gerardo Parra was thrown out trying to steal second in the third inning. That leaves him 6 of 15 on stolen base attempts. ... Miami moves on to San Francisco, opening a four-game series with the Giants on Thursday night. RHP Tom Kohler (0-5, 5.09 ERA) goes for the Marlins, RHP Chad Gaudin (2-1, 2.83) for San Francisco. ... The Diamondbacks are off Thursday, then conclude a six-game homestand with three against Cincinnati. LHP Wade Miley (4-6, 4.64) starts Friday's opener for Arizona, with RHP Johnny Cueto (4-0, 2.08) going for the Reds.