ARLINGTON, Texas (TNS) — On a 94-degree afternoon at Globe Life Park, the Royals' bats went cold after three innings but provided just enough offense to beat the Rangers 5-3 on Sunday.

Starting pitcher Jason Hammel labored through 5 1/3 innings, facing 22 batters and throwing 102 pitches. Yet as he gave up four hits (three doubles) and issued two walks, he recorded a season-high 10 strikeouts and surrendered no runs for the second time this season.

Hammel (2-5) hadn't earned a victory in 8 1/2 months and 13 starts until he beat the Cardinals in St. Louis this week.

He's now won two consecutive starts, during which he's struck out 16 batters and logged 12 1/3 innings.

"His record doesn't indicate the way that he's really pitched," Royals manager Ned Yost said. "Days that he's gotten beat, it's been on two or three pitches. It's not a combination of a bunch of pitches and walking guys. He's been around the plate extremely consistently. His last two starts have been exactly what you saw today: Commanded his slider well, spotted his fastball well, changed speeds, moved the ball around."

The Rangers threatened Hammel's chances at a win in the seventh. In a span of 11 pitches, Royals reliever Eric Stout yielded three runs on three hits, including Joey Gallo's leadoff homer and Robinson Chirinos' two-run shot to straight-away center field.

But Kevin McCarthy, Jason Adam and Kelvin Herrera held the Rangers at bay the rest of the way.

The offense, which scored all its runs in the first three innings off Rangers starter Cole Hamels, stranded five runners and was 1 for 4 with runners in scoring position.

First baseman Hunter Dozier recorded his third straight multi-hit game, going 2 for 4 with a two-run single in the first inning.

To secure their first winning road trip of the season, the Royals needed little else.

After losing seven of eight from May 12-20, the Royals went 4-3.

Drew Butera and Salvador Perez, who was the Royals' designated hitter Sunday, launched a home run each off Hamels. Butera's two-out solo shot to the right-field corner was the first opposite-field home run of his career and gave the Royals a 3-0 lead in the second. Perez padded the Royals' advantage one inning later with a two-run homer that landed in the visiting bullpen 394 feet from home plate.

Perez has driven in 28 runs and clubbed nine homers since he made his season debut on April 24. Before Sunday's performance, his RBI total (26) in the last month-plus ranked third in the American League behind Baltimore's Manny Machado and Boston's JD Martinez (27 each).

For the first time since he joined the Royals bullpen in place of the injured Justin Grimm earlier this month, rookie Jason Adam received a chance to pitch in a close game in which the Royals had a lead — and he struggled. He threw a pair of wild pitches after surrendering a soft-hit single to Rangers third baseman Isiah Kiner-Falefa to start the eighth. He lost an eight-pitch battle with Jurickson Profar that put runners on the corners.

But after a mound visit from pitching coach Cal Eldred, Adam struck out Gallo despite falling behind in the count 3-0 and retired Rougned Odor on a pop-up to third base.

He threw 29 pitches in the inning.

"He was limited to one pitch and you don't want to be limited to one pitch against the Rangers, especially that part of the lineup," Yost said. "For him to get through it kind of shows you his fastball is a pretty good pitch. It's a short arm delivery with some deception there that the ball jumps on you."