MIAMI (AP) When Jose Fernandez threw his final pitch of the night, he pulled up in pain, rubbed his right knee and limped to the dugout.
He still looked better than his opponent.
Fernandez pitched seven innings and shook off calf cramps to help the Miami Marlins beat the Kansas City Royals 3-0 and snap their nine-game winning streak Wednesday.
Fernandez (13-7) grimaced after retiring Christian Colon with his ninth strikeout to end the seventh.
''I was cramping for the last five pitches,'' Fernandez said. ''I was sweating and changed my uniform twice. Sweating, sweating. The last pitch, when I finished I felt the cramp and I was, `Oooowwwww.' I came in and took some Gatorade, and I'm ready to go - fantastic.''
The irrepressible Fernandez was laughing with teammates in the dugout in the ninth inning and joined in the postgame celebration on the field. When asked if the Marlins' ace was indeed OK, manager Don Mattingly laughed.
''Did you see him after the game?'' Mattingly said.
Fernandez's nine strikeouts increased his season total to 213, breaking the Marlins record of 209 set by Ryan Dempster in 2000. Fernandez allowed six hits and won for the first time since July 23 to snap his three-game losing streak, a career worst.
''From the last five or six starts, today was a little improvement,'' he said.
Fernandez also had the Marlins' first two hits, hiking his average to .286, and improved to 27-2 at Marlins Park.
Christian Yelich broke a scoreless tie in the sixth with a two-run single.
The Royals went 0 for 8 with runners in scoring position against Fernandez. They loaded the bases in the second, but Fernandez escaped by retiring Paulo Orlando and Colon. Their first two batters singled in the sixth, but Alex Gordon struck out and Alcides Escobar bounced into a double play.
Orlando struck out in all four at-bats against Fernandez.
''He was just tough,'' Royals manager Ned Yost said. ''He had a really, really good slider and went to it when he got in trouble.''
Fernando Rodney pitched around two singles and a walk in the ninth for his 25th save and eighth with Miami. He was helped by a spectacular leaping catch by shortstop Adeiny Hechavarria to rob Escobar.
''That changed the game,'' Escobar said. ''I hit that ball really good. When I saw it, I said, `Oh! That's a great play.'''
Dillon Gee (5-7) allowed only two of the first 18 batters to reach - and both times it was Fernandez. He had an infield single in the third and another single in the sixth, when Gee proceeded to unravel.
The Marlins collected four consecutive singles, the last of them Yelich's hit off reliever Peter Moylan. Marcell Ozuna followed with a sacrifice fly.
Marlins: LHP Wei-Yin Chen (sprained elbow) threw a bullpen session for the first time since being sidelined July 20, and he's on schedule to return in mid-September. ... Ozuna was back in the lineup after leaving Tuesday's game to be with his pregnant wife, who became ill and was briefly taken to the hospital. She and the baby were doing fine Wednesday, Ozuna said.
Royals: LHP Mike Minor, who has not pitched in the majors since 2014 after suffering a torn labrum in 2015, is being shut down for the year after struggling in several rehab starts.
RHP Edinson Volquez (9-10, 5.04) is scheduled to face Marlins RHP Tom Koehler (9-8, 3.82) in the series finale. Volquez is 6-0 in seven career starts against Miami. Koehler is 3-0 over his past six starts with a 1.62 ERA.