The Twins scored twice in the ninth inning Friday to get within a run, but the rally ended when Trevor Plouffe popped out in foul territory against Royals closer Jonathan Broxton, giving Kansas City a 4-3 victory.

The Twins had the tying run on third, but Broxton wiggled out of trouble to earn his 20th save.

But Broxton is always in trouble. He has allowed baserunners in nine consecutive save opportunities and 16 of his past 19.

What didn't make sense was how the Twins could get shut down by starter Luis Mendoza.

The righthander entered Friday with a career record of 8-13 and ERA of 6.45, amassed over 51 games, including 24 starts. He recently was inserted into the Royals rotation and pitched well in two of three starts.

Against the Twins, though, he has looked like an All-Star.

He shut the Twins down for a career-high eight innings Friday while throwing a career-high 115 pitches. Eric Hosmer's infield single off Kyle Waldrop's glove in the seventh allowed Yuniesky Betancourt to score what proved to be the winning run.

The Twins got their first look at Mendoza on June 6, when he entered the game in the first inning to replace the injured Felipe Paulino. He gave up two runs over five innings and took the loss in a 4-2 Twins victory -- but went to another level Friday.

"He did it again," Twins manager Ron Gardenhire said. "He mixed his pitches really well. Put the ball in and out. Really didn't give us much of a chance. We didn't do too much off the guy. Fantastic job by him."

Ryan Doumit, who signed a two-year contract extension earlier in the day, drove in Plouffe with a single in the second, their only run until the ninth. The Twins had only five hits and no walks off the 28-year-old Mendoza in eight innings.

"He did a very good job of -- not just me but 1 through 9 -- of establishing the inner part of the plate," Twins shortstop Brian Dozier said. "When pitchers establish that early you have the hitters on their toes and conscious of the inside part of the plate. He did a very good job of pitching."

Pitching inside was evident in how Mendoza (3-4) got Denard Span to ground out to first base in all three at-bats against him.

Mendoza's numbers are terrible when he goes through a batting order for the third time -- a .548 batting average with three home runs entering Friday. The third time through the order Friday: nine up, nine down.

"I think it's because I just stayed aggressive," Mendoza said. "Stay with my sinker to lefties inside and to righties inside, too. It worked well, too."

The Royals took a 1-0 lead in the first when Billy Butler came through with a two-out, two-strike single off of Twins lefthander Brian Duensing, scoring Alex Gordon. Kansas City catcher Salvador Perez hit an opposite-field homer in the second that made it 2-0. Doumit's RBI single in the bottom of the inning made it 2-1.

Kansas City knocked out Duensing in the fifth with three consecutive hits, including an RBI double by Betancourt, to make it 3-1. Duensing, in his second start since being inserted into the rotation, threw 66 pitches as he continues to build up his endurance. His problem Friday was that he left too many pitches up in the strike zone.

"It was kind of a step forward," said Duensing, who gave up three runs, eight hits and no walks and struck out one, "but not very far."