ST. PETERSBURG, Fla. -- B.J. Upton turned a game of missed opportunities into a victory for Tampa Bay.
"It was great to see," Tampa Bay manager Joe Maddon said. "I really felt we were going win somehow."
"Whatever happened we just knew we had to keep grinding at the end," Rays left fielder Crawford said. "B.J. hitting the homer at the end, that's from us just keeping at it. We just didn't worry about what we did earlier in the game."
Upton has two consecutive games with two RBIs after not having a multiple RBI effort in his previous 46 games this year.
"The important thing is we got a win," Upton said.
Upton's homer came on a first pitch sinker and made it 3-2.
"I've thrown that pitch a million times and it's been fouled off and hit into the ground a million times," Wright said. "He just got underneath it and crushed it."
Shields (5-4) gave up six hits and had eight strikeouts. He has won two consecutive starts, allowing four runs over 15 innings.
"That's what this team is all about. It brings back memories of last year," Shields said.
The defending AL champion Rays returned to the .500 mark at 28-28. Tampa Bay has lost four times previously when having an opportunity to climb above .500 since starting the season 4-3.
"We need to maintain our traction and keep moving it forward," Maddon said,
Crawford also homered for the Rays, who have won five of six following a season-high five-game losing streak. J.P. Howell pitched the ninth for his second save.
Kansas City right-hander Gil Meche gave up one run and six hits in six-plus innings. The Royals have lost a season-high seven games.
Billy Butler had a two-run, two-out double to put the Royals ahead 2-0 in the third, which ended Kansas City's stretch of 15 scoreless innings. The double came after Alberto Callaspo had hit into a bases-loaded double play.
"I thought for sure we had that one," Butler said. "We just have to put it behind us."
Tampa Bay threatened in each of the first six innings, but failed to score after going hitless in 12 at-bats with runners in scoring position. The Rays left 10 runners on base over the stretch.
"It wasn't an easy six innings," said Meche, who is winless in his last six starts. "The good thing was I kept getting out of it. I just kept waiting to get through a couple innings that somehow weren't so tough, and it just never happened."
The Rays finally got on the scoreboard when Crawford hit a leadoff homer in the seventh that ended Meche's day. Three of Crawford's four homers this season have come in the last six games.
Tampa Bay 3B Evan Longoria, who left Tuesday's game with tightness in his left hamstring, could return to the starting lineup by Saturday. ... The Royals activated outfielder Coco Crisp from the bereavement list and optioned infielder Tug Hulett to Triple-A Omaha. ... Rays SS Jason Bartlett (sprained left ankle) has started hitting off a tee. ... Kansas City DH Mike Jacobs went 0 for 4, including two strikeouts, and has two hits in last 30 at-bats.