NEW YORK (AP) — Aaron Judge winced, and so did most everyone else at Yankee Stadium.

All geared up for a pennant race, the New York Yankees caught a bad break Thursday night: Their All-Star slugger sustained a fractured right wrist when he was hit by a fastball and is expected to miss three weeks.

After a 7-2 win over the Kansas City Royals, the Yankees said Judge had a chip fracture. The team said no surgery has been recommended, and estimated he wouldn’t be able to swing the bat in a game until mid-August.

“I’m concerned, obviously,” manager Aaron Boone said, even before the final diagnosis.

His fans were, too.

As Neil Walker batted with two outs in the Yankees seventh, several thousand people in the sellout crowd of 46,965 suddenly switched on their cell phone lights and shined them toward the field.

“It was a candlelight vigil for Aaron Judge,” fan Al Orrico said as he shopped postgame in the souvenir store. “I saw some people doing it, then a person behind me showed me an app and said it was a candlelight vigil for him.”

The hugely popular Judge is hitting .285 with 26 home runs and 61 RBIs.

Normally the right fielder, Judge was the designated hitter. He grimaced when he was stung by a pitch from Jakob Junis in the first inning, was checked by a trainer and stayed in. Judge an infield hit the next time up and then was pulled for a pinch-hitter in the fourth.

Boone said when Judge tried taking swings in the indoor batting cage between at-bats, “he just didn’t have a lot of strength.”

When told he was coming out of the game, Judge “didn’t balk at it,” Boone said.

Junis said the pitch didn’t wind up where he intended it.

“I was just trying to go heater away, and it totally got away from me,” Junis said. “Tried humping up a little extra on a little and it just really open and let it go.”

Judge was seen by a team doctor at the stadium and an X-ray “was a little unsure,” Boone said. Judge was then taken to a hospital for an MRI and CT scan.

On a busy day for the Yankees, Sonny Gray (8-7) pitched five shutout innings to win three straight starts for the first time since last July. He exited soon after getting nicked in the thumb of his pitching hand by a hard grounder.

Gray was slated for an X-ray, too. Boone indicated the ball might’ve hit the muscle part of Gray’s hand, lessening the risk of something serious.

Didi Gregorius hit a three-run homer for New York, which is 4½ games behind AL East-leading Boston. Center fielder Aaron Hicks threw out Alex Gordon at the plate to end the game as Gordon tried to score from second on a single.

Before the game, the Yankees obtained Toronto left-hander J.A. Happ in a trade for infielder Brandon Drury and minor league outfielder Billy McKinney. Also, ace reliever Zach Britton tossed a perfect eighth inning in his New York debut, two days after being acquired from Baltimore for three pitching prospects.

Junis (5-11) is 0-8 in 10 starts since beating the Yankees in mid-May. He has allowed a major league-high 25 home runs, and the drive by Gregorius made it 6-0 in the fourth.

Gregorius homered one pitch after shortstop Adalberto Mondesi bounced a throw to first on a routine grounder with two outs. As Gregorius rounded the bases, Mondesi took off his glove and wandered into shallow center field.

“No, I saw I had a little bit of time. I didn’t let it go,” he said.

Mondesi also misplayed a grounder in the first for another error.