Updated

Jose Fernandez was dealing, as he struck out a career-high 13 batters to help the Miami Marlins edge the Pittsburgh Pirates, 3-2, in the rubber match of a three-game series.

Fernandez (7-5) threw a 97-pitch gem, allowing just two runs on five hits without a walk over eight stellar innings. The 13 strikeouts set a new Marlins rookie record.

"I was really moving out there with the strikeouts, it was really amazing," said Fernandez. "Every time I pitch here the crowd's support is amazing."

Giancarlo Stanton continued his recent offensive surge, going 2-for-3 with a solo homer that put Miami ahead in the sixth. Ed Lucas and Donovan Solano each added an RBI for the Marlins, winners in three of their last four contests.

Gerrit Cole (6-3) had an impressive outing himself but just caught fellow rookie Fernandez on the wrong day. He yielded three runs on four hits and two walks while fanning eight in seven frames

Russell Martin and Clint Barmes each drove in a run for the Pirates, who ended their 10-game road trip with a .500 record.

"We're not satisfied, we wanted more," said Pirates manager Clint Hurdle about the roadtrip. "It was a challenging trip out, we'll take the .500 and move on."

The Pirates opened the scoring in the second when Martin connected on an RBI double to the left-center field wall to plate Pedro Alvarez, who reached on a base hit. After stealing third, scored on a Barmes two-out single to center.

After Stanton walked and Logan Morrison singled in the fourth, Lucas delivered a base hit past the glove of diving first baseman Gaby Sanchez to score Stanton. Solano's sac fly to center tied the game at 2-2.

Stanton crushed a first-pitch fastball to deep center to give the Marlins a 3-2 advantage in the sixth.

Fernandez, itching for his first career complete-game, handed the ball over to Steve Cishek in the ninth. He had runners on first and second but was able to get Garrett Jones to ground out to secure the victory and earn his 22nd save of the year.

Game Notes

Prior to the game, Pittsburgh placed outfielder Travis Snider on the 15-day disabled list and recalled catcher Tony Sanchez from Triple-A Indianapolis ... Fernandez's 13 strikeouts are tied for fifth-most in team history ... The Pirates have struck out 62 times over the last five games ... Miami has won 15 of the last 21 encounters with Pittsburgh ... Fernandez hasn't allowed more than three runs in 10 starts since June 1 ... Pittsburgh went 1-for-4 with runners in scoring position.