MIAMI -- Jorge Lopez did a two-month stint in the bullpen, and now the right-hander is performing like the pitcher who earned a spot in the starting rotation at the beginning of the season.
"I just kept it simple, guys helped me out so much," Lopez said. "I just attacked the hitters and stuck with the plan."
Lopez (3-7) struck out six in his longest outing since May 3, when went seven innings against Detroit. He lost his first six decisions before being moved to the bullpen June 5.
"He went through phases when he wasn't very good," Royals manager Ned Yost. "We put him in the `pen and gave him another opportunity as a starter. He has stepped up and taken advantage of the opportunity."
Dozier hit his 25th homer, a solo shot off Miami reliever Jeff Brigham in the eighth.
"I was trying to attack the first pitch, he throws hard," Dozier said. "We were trying to get as many runs as we can but it was our pitching staff that kept us in the game."
Kevin McCarthy pitched a perfect seventh before Scott Barlow allowed a pinch-hit, two-out single by Curtis Granderson and a double by Jon Berti in the eighth. Barlow retired Isan Diaz on a deep fly to center for the third out.
Ian Kennedy earned his 27th save.
The Marlins were shut out for the 21st time this season.
"We just couldn't get anything going all night," Miami manager Don Mattingly said.
O'Hearn's double off Miami starter Pablo Lopez in the seventh gave the Royals a 2-0 advantage.
Pablo Lopez (5-8) had his longest outing since returning from the injured list Aug. 26. The right-hander, who missed two months because of a shoulder strain, lasted 6 1/3 innings, allowed two runs, eight hits and struck out four.
"A step forward," Pablo Lopez said. "A great defense behind me gave me the confidence to keep pounding the strike zone. I want to finish the season healthy, that's my number one priority."
The Royals took a 1-0 lead on a run-scoring single by Merrifield in the third. Merrifield drove in Meibrys Viloria, who had singled and advanced to second on a sacrifice bunt by Jorge Lopez.
Bryan Holaday attempted to tie it in the fifth, running from first on Pablo Lopez's opposite field double to left center. Merrifield's relay throw from centerfielder Brett Phillips caught Holaday at the plate.
MERRIFIELD IN THE RIGHT PLACE:
Although Phillips overthrew shortstop Adalberto Mondesi, the first cutoff target on Lopez's double, Merrifield was perfectly situated to catch the relay and throw home to get Holaday, the Marlins catcher, for the final out of the inning.
"Just standard spring training 101," Merrifield said. "Brett made a good throw, a little high, but we had two guys there. Luckily they had a catcher running and we were able to get him out. For us to keep it a 1-0, it was a big point in the game."
ODD PAIRING BETWEEN NAMESAKES:
Friday's matchup between the Lopezes was only the second time in major league history that featured two starting pitchers with a Lopez surname, according to the Elias Sports Bureau. The other game also featured Jorge Lopez, who faced Reynaldo Lopez, of the Chicago White Sox, April 16.
Royals: RHP Jesse Hahn (elbow sprain) will have rest days between outings after a scoreless inning in his season debut against Detroit on Thursday. "We want to make sure that in this rehab process that we're doing it right and we're protecting him," manager Ned Yost said.
Marlins: RHP Jordan Yamamoto (forearm strain) threw a bullpen session before Friday's game. Yamamoto was placed on the 10-day injured list Aug. 28.
Royals: LHP Danny Duffy (5-6, 4.89) will start the middle game of the series Saturday.
Marlins: LHP Caleb Smith (8-9, 4.30) will make his first career start against the Royals. Smith has lost four of his last five starts.
More AP MLB: https://apnews.com/MLB and https://twitter.com/AP-Sports
Twins pitcher Jake Odorizzi: Betting on self as 2020 free agent
Pitcher Jake Odorizzi said accepting the Twins' $17.8 million qualifying offer came down to "betting on myself and returning to a place I know very well and enjoyed."
Sources: Pirates hire Ben Cherington as new GM
The Pirates have hired Ben Cherington as the team's new general manager, according to multiple reports and confirmed by ESPN.
AL Central offseason preview: Francisco Lindor's future, Twins' rotation in focus
The Indians have a big decision to make about their biggest star, Minnesota needs a lot of arms and the White Sox could be on the cusp of good things.
Way-too-early 2020 MLB awards predictions
Will Juan Soto rise to the top? Can anyone unseat Mike Trout? Here's the first look at next year's hardware hopefuls.
Trout on 3rd MVP: 'I always try to be the best player'
Mike Trout joins SVP after winning the American League MVP award and says it was special to be recognized as the league's best player for the third time.
Bellinger: Winning MVP 'means everything'
Cody Bellinger joins SportsCenter after being announced as the National League MVP and describes how special the award is to him and his family.