ST. LOUIS -- Joe Kelly started Wednesday night just trying to keep his emotions in check.
He ended it with only the third seven-inning outing in his 41 major league starts, a hit off the best man at his wedding and a key part in a win for his new team.
Shortstop Xander Bogaerts' sacrifice fly in the top of the ninth inning snapped a tie and gave the Boston Red Sox a 2-1 victory over the St. Louis Cardinals at Busch Stadium.
Bogaerts drove in both runs for Boston (50-63), tying the game with a two-out RBI double in the fourth, but the night was all about Kelly and St. Louis starter Shelby Miller.
Best friends who each served as best men at each other's weddings, Kelly and Miller were stunned when Kelly and outfielder Allen Craig were dealt to the Red Sox on July 31 for veteran starter John Lackey.
After working seven innings and allowing just three hits, a run and four walks to the guys who were his teammates at this time a week ago, Kelly insisted it wasn't about revenge.
"No hard feelings," he said. "Revenge isn't the right word. I wanted to win this game for the Red Sox."
After a shaky first inning that saw him give up a two-out RBI single to Matt Adams, Kelly escaped a second inning in which he yielded a leadoff single and two walks, getting a double play ball and Bogaerts' diving stop behind second to deny third baseman Matt Carpenter a run-scoring hit.
Kelly allowed just two baserunners after the second, inducing a series of weak groundouts with his sinking fastball.
"It was easy for him to get into the bottom of the zone repetitively," Boston manager John Farrell said. "After the first inning, he settled down. He was outstanding; he threw three quality pitches for strikes."
Miller matched Kelly pitch for pitch in his seven innings, permitting just four hits and a run with a walk and four strikeouts. Throwing 62 of his 88 pitches for strikes, Miller retired the last 10 men he faced on just 29 pitches.
In his last three starts, covering 18 2/3 innings, Miller walked just one batter after passing 55 men in his first 110 innings.
"I thought it would be a little more odd than it really was," Miller said of facing Kelly. "You don't try to make too much of it. The biggest thing is to go out there and pitch. Hats off to him for pitching well and matching every inning with mine."
Kelly even touched Miller for a leadoff infield single in the third, a play originally ruled an out but changed after a replay review.
After the best friends left without a decision, the Red Sox won the bullpen battle. Junichi Tazawa (2-3) worked a 1-2-3 eighth, and closer Koji Uehara pitched around two singles in the ninth for his 23rd save.
Cardinals closer Trevor Rosenthal (1-6) got into instant trouble in the ninth, allowing a leadoff single to left fielder Yoenis Cespedes and a double to first baseman Mike Napoli. Pinch hitter David Ortiz was intentionally walked to load the bases with no outs.
Bogaerts jumped on the first pitch and lined out to center fielder Jon Jay, easily scoring Cespedes.
"I knew he wanted to get ahead of me with a fastball and go to other pitches," Bogaerts said of his game plan for that at-bat. "I was happy there were no outs."
It was just the third win in 14 games for Boston. The Cardinals (60-52) missed out on a chance to tie the Milwaukee Brewers, 7-4 losers to the San Francisco Giants, for first place in the National League Central.
NOTES: Tuesday night's crowd of 43,432 at Busch Stadium snapped a streak of 12 consecutive home sellouts for St. Louis. The Cardinals drew more than 40,000 for every home game and sold out 37 of their 56 home games. ... Boston INF Kelly Johnson (strained left groin) is 0-for-6 with two walks through two games on a rehab assignment with Double-A Portland. Johnson was acquired from the New York Yankees on July 31 for SS Stephen Drew. ... Cardinals OF Matt Holliday's ejection in the seventh inning Tuesday night was the third of his career and his first since June 25, 2011.