KANSAS CITY, Mo. — Salvador Perez took one step down the first-base line and gazed up into the night, admiring his work as it soared toward the seats in left-center field. One step was followed by another, and then another, and finally, an easy trot as the Royals’ dugout erupted into wave of white jerseys and shouting.

For a moment Tuesday night, it appeared the Royals’ latest winning streak might die at three games. And then Perez delivered a two-run shot against Indians reliever Bryan Shaw in the bottom of the eighth inning, delivering a 3-2 victory in front of a crowd of 29,293.

The homer — Perez’s 10th of the season — pulled the Royals to 34–30 on the season and just one game out of first place after two straight victories over the first-place Indians, who dropped to 35-29. Kansas City clinched a series victory and can notch a sweep on Wednesday night at Kauffman Stadium.

For close to eight innings, the Royals could not secure a clutch hit against Indians starter Josh Tomlin, leaving runners on base and opportunities untapped. In the eighth, they received new life after third baseman Jose Ramirez couldn’t handle a chopper from the bat of Eric Hosmer. The play was scored a hit, and it set up a two-out opportunity for Perez after Lorenzo Cain struck out.

Perez saw one pitch — a 95-mph cutter — and took a violent hack. The ball jumped off the bat and landed in the seats in front of the fountains in left-center field.

The Royals had scored their first run on a solo homer from Whit Merrifield in the bottom of the third. The blast had marked 11 straight solo home runs for the Royals, dating back to a series in Cleveland in early June. Perez finally broke the streak — and it came at the perfect time.

With a lead, the Royals handed the game to Joakim Soria, who notched the win with Wade Davis and Kelvin Herrera unavailable after pitching three straight nights.

Tomlin, the Indians’ starter, had allowed just one run in seven innings. The performance bested Royals right-hander Chris Young, who allowed two runs in 41/3 innings.

Young was making his first start since allowing four solo homers in a 7-0 loss to the Indians on June 5 in Cleveland. After a day off last Thursday, the Royals had elected to skip Young’s spot in the rotation, keeping the rest of the starters on regular rest and pushing Young back to the spacious confines of Kauffman Stadium.

In 41 innings this season, Young had served up a team-leading 17 homers. The number included nine solo shots over 71/3 innings in his last two starts. The number hit 10 — and 18 for the season — when Carlos Santana turned on an 81-mph slider in the top of the third inning. The offering hung in the middle of the strike zone. Santana put his barrel on the baseball. It was the 13th straight solo homer allowed by Young, dating back to a start in Anaheim on April 27.

Young would last just 41/3 innings, surrendering two earned runs and five hits. The second run came across in the bottom of the fifth, after another miscommunication between third baseman Cheslor Cuthbert and Perez. With a runner on first base, Santana lifted a foul ball along the third base line. Perez settled under the ball, then appeared to move out of the way at the last moment as Cuthbert came into the picture.

It is worth pointing out here, of course, that Cuthbert had taken out Perez on a similar play earlier this season, leaving the catcher sidelined for six days with a quadriceps contusion. This time, there was no collision. But with an extra out, the Indians manufactured another run against Young and reliever Dillon Gee.

The Royals had knotted the game at 1-1 on Merrifield’s solo blast in the bottom of the third inning. In the process, Merrifield became the first Royals rookie to homer in consecutive games since Mike Moustakas in 2012. For another night, he sparkled with his bat and his glove.

In the top of the first, Merrifield turned a double play while picking a low throw from Cuthbert. He ended the top of the fifth in similar fashion, making a quick turn after a solid defensive play from Alcides Escobar in the hole.

The defense kept the Royals in the game. Perez delivered a victory with one swing in the eighth.