KANSAS CITY, Mo. (AP) — Bobby Witt Jr. homered during Kansas City’s five-run rally in the seventh inning, leading Brady Singer and the Royals over the Arizona Diamondbacks 5-3 Wednesday night.

Arizona starter Zac Gallen extended his shutout streak to 27 1/3 innings, leaving after the sixth with a 1-0 lead. He gave up three hits, walked three and struck out six.

“I just felt like I was trying to worry about (the shutout streak),” Gallen said. “It’s one of those things where if you let it get too big and control you too much it can be a problem. I felt like that in the first couple innings. I was trying to worry about that too much. I just need to do my job and not worry about it.”

The Royals broke loose in the seventh against the Arizona bullpen. Kansas City finished with seven hits, snapping an eight-game streak of six hits or less.

“Guys coming through in big situations, that situational hitting is what we need to fight our way in close games,” Royals manager Mike Matheny said. “And then Bobby Witt does what Bobby Witt does.”

Christian Walker hit his career-high 30th homer for Arizona, which has dropped four of five.

Singer (7-4) allowed four hits, including a fifth-inning solo homer by Daulton Varsho, in seven innings.

“I felt good,” Singer said. “The fastball, slider were working. The fastball had a lot of movement on it.”

Singer is 4-1 over his past 10 starts, posting a 2.14 ERA in that span.

“I don’t know a pitcher around the league who has thrown better than what the guy on the other side has, except maybe our guy,” Matheny said. “He’s going to have to be good because their guy isn’t giving up anything. He kept us in the game right down to his last hitter, figured out how to get it done and let his offense figure out a way to do something.”

Gallen had his fifth scoreless outing in the past seven starts, with a sparkling 0.80 ERA in that stretch.

Kansas City tagged Noe Ramirez (4-4) and Joe Mantiply for five runs in the seventh.

After Nicky Lopez made it 1-all with a suicide squeeze bunt, MJ Melendez hit a go-ahead single.

“That’s part of Nicky’s game,” Matheny said. “It’s a weapon that Nicky has. He’s so good at bunting. In that situation it’s a really hard play to defend.”

“It just started with what (Kyle Isbel) did leading off and Nicky getting him in, and MJ getting that base hit,” Witt said. “That was an energy booster. Everything was building, building. You could feel it building and we scored some more runs.”

Witt hit his team-leading 18th homer, a three-run drive to deep left-center field.

“The ball coming off Bobby’s bat is different,” Matheny said. “He’s been gifted with great hands and strength and bat speed. It’s impressive to watch.”

Witt has extra-base hits in five of his last six games. He ranks first or second among major league rookies in extra-base hits (45), homers, doubles (21), triples (six), RBIs (64), runs (63), and steals (24).

“Just trying to get back to feeling comfortable, getting back to being myself and go have fun and compete,” Witt said.

TRAINER’S ROOM

Royals: RHP Josh Staumont (right biceps tendinitis) and RHP Zack Greinke (right forearm tightness) were placed on the 15-day injured list. RHP Collin Snider and LHP Anthony Misiewicz were recalled from Triple-A Omaha.

UP NEXT

Diamondbacks: LHP Tommy Henry (2-2, 3.57 ERA) starts Friday against White Sox RHP Johnny Cueto (6-5, 2.58 ERA) in Chicago.

Royals: LHP Kris Bubic (2-8, 5.29 ERA) pitches on Friday against the San Diego Padres and LHP Joe Musgrove (8-6, 2.91 ERA).