Sandy Leon prolonged the game with a baserunning mistake in the third inning.
When Boston's catcher came up in the 12th, he ended it.
Leon hit a three-run homer - the first walkoff of his career - and Chris Sale pitched seven innings of three-hit ball in his Red Sox debut to lead Boston to a 3-0 victory over the Pittsburgh Pirates on Wednesday night.
"It's nice to get the win. All the better to walk it off. It's special," said Sale, who was Boston's big acquisition of the offseason. "If you told me tonight it was going to be 0-0 in the 12th, I probably would have given you a crazy look."
Leon also doubled in the third inning but got thrown out at the plate after running through third base coach Brian Butterfield's stop sign. It was scoreless into the bottom of the 12th, when Antonio Bastardo (0-1) walked Jackie Bradley Jr. and Pablo Sandoval with one out.
Leon followed with a drive over the Green Monster to end a cold night for the Red Sox, who also beat Pittsburgh in the season opener on Monday.
"He certainly redeemed himself with the final swing tonight," manager John Farrell said.
Joe Kelly (1-0), the sixth Red Sox pitcher, earned the victory with two innings of one-hit relief as the Red Sox won their seventh straight interleague game at Fenway Park. The Pirates did not get a runner past first base.
"I'm not going to overcook this thing," Pittsburgh manager Clint Hurdle said. "That one swing makes it look bigger than it was, but there wasn't a lot of separation."
SALE OF THE CENTURY
Sale, who walked one and struck out seven, was acquired from the Chicago White Sox for a package of minor leaguers that included No. 1 prospect Yoan Moncada. He gave the Red Sox a rotation that included two Cy Young winners and three All-Stars.
"He was nasty," said Leon, who had three hits. "He was mixing his pitches, getting ahead in the count. He was fun to catch."
Jameson Taillon matched Sale's shutout for seven innings, allowing five hits while walking three and striking out six.
The Red Sox did threaten against him in the third, when Leon was thrown out at the plate by Andrew McCutchen, who had moved from center field to right this season. Newly acquired first baseman Mitch Moreland also hit a ball deep in the fourth, but McCutchen caught it at the short bullpen wall.
"I knew the wall was close," he said. "But I didn't realize how close until I hit it."
Boston loaded the bases with two outs in the 10th, thanks in part to a single by Leon, but Pirates closer Tony Watson retired opening day hero Andrew Benintendi on a weak grounder to second to end the inning.
Red Sox: OF Mookie Betts missed the game with the flu. Brock Holt and Robbie Ross were also stricken with a bug. ... David Price threw long toss from 100 feet and also made about 25 pitches from a mound. "The most encouraging thing is every throwing session he goes through, he comes out feeling good physically," manager John Farrell said. ... Bradley clutched his left leg after getting spiked on a stolen base in the 12th, but he remained in the game. Afterward, he said his leg was "great."
Pirates: RHP Chad Kuhl (5-4 in 2016) will pitch the series finale.
Red Sox: LHP Eduardo Rodriguez (3-7 last season) makes his 2017 debut in the matinee game.