The Yankees' Sonny Gray pitches in the first inning against...

The Yankees' Sonny Gray pitches in the first inning against the Kansas City Royals at Kauffman Stadium on Sunday in Kansas City, Missouri. Credit: Getty Images / Ed Zurga

KANSAS CITY, Mo. — This, finally, was the Sonny Gray the Yankees thought they were trading for.

Granted it was against the woeful Royals but since Gray has had far more downs than ups since being acquired last July, all involved were happy to take it.

The righthander was brilliant Sunday afternoon, retiring the first 14 hitters he faced in the Yankees’ 10-1 win over the Royals in front of 24,121 at Kauffman Stadium.

“Completely in control,” veteran Brett Gardner said.

Said Aaron Boone of Gray: “He was on the attack all day. He was electric.”

The Yankees, who received a pair of two-run homers by Tyler Austin, part of a 14-hit attack that also included homers by Miguel Andujar and Austin Romine, won for the 21st time in 25 games and improved to an MLB-best 30-13. After taking two of three against the Royals — the Yankees hit five homers in Saturday’s 8-3 victory — the Yankees headed to Arlington for a three-game series against the Rangers which begins Monday night.

Gray, 6-10 with a 4.70 ERA as a Yankee, including 2-3 with a 6.39 ERA this season, had not lasted more than six innings in a start this season.

He went eight innings Sunday, shutting out the Royals (14-32) for seven before they got on the board in the eighth. Gray, who did not allow a hit until Hunter Dozier’s two-out single in the fifth, was so efficient a complete game seemed probable as he entered that inning at just 74 pitches. But, in the words of Boone, Gray had “emptied the tank” in getting there and allowed two singles and a walk in his final inning.

Still, with a terrific slider and curveball that allowed him to work ahead pretty much all afternoon, Gray allowed one run, four hits and a walk. He struck out five.

“After the rainout [Wednesday in Washington], I had a few extra days to work on some stuff and iron some stuff out,” Gray said.

Gray, who allowed five runs in his previous start May 11 against Oakland, said most of the tweaks he and pitching coach Larry Rothschild worked on was getting him into a better “rhythm.”

Gray, known as a slow worker, Sunday presided over a game that lasted 2 hours, 31 minutes, tied for the fastest game of the Yankees season.

“His rhythm was there,” Romine said. “He executed all his pitches today. His biggest thing today was he was able to throw his slider and curveball for strike one. It really keeps guys off balance.”

“I knew I wanted to attack,” Gray said. “Any time I’m getting ahead in the count and feeling confident where I’m putting the baseball, I feel really good about the results.”

As did the offense for a second straight game. Austin, likely to lose significant playing time, though probably not his roster spot, when Greg Bird comes off the DL — an occurrence Aaron Boone said could happen within the week — is determined to make that a difficult call.

The 26-year-old hit two homers Sunday, giving him eight this season, fourth-most on the club. He blasted a two-run shot off lefty Eric Skoglund (1-4) in the third inning that made it 2-0 and another two-run shot, also off Skoglund, in the fifth that made it 6-0.

Andujar went 3-for-5, finishing a double shy of the cycle. He and Romine, Gray’s personal catcher meaning a day off for Gary Sanchez, each homered in the ninth to make it 10-1.

“If you’re going to be a complete team, if you’re going to be a potentially great team,” Boone said, “you’ve got to get contributions from not just your stars at the top and the middle of your lineup.”

The Good Sonny

Sonny Gray looked like a different pitcher Sunday than the one who was roughed up against his former team, the A’s, in his last outing.

Sunday at Royals: 8 IP, 4 H, 1 ER, 1 BB, 5 SO, 0 HR

May 11 vs. A’s: 5 IP, 9 H, 5 ER, 3 BB, 2 SO, 2 HR

More Yankees headlines

ONE-DAY SALE25¢ for 5 6 months

ACT NOWSALE ENDS SOON | CANCEL ANYTIME