Baltimore’s David Lough celebrates after scoring on an RBI single hit by J.J. Hardy in the 12th inning. (Michael Dwyer/AP)

Winning two of three games this weekend at Fenway Park wasn’t easy, but the Baltimore Orioles had reason to celebrate after surviving their series finale Sunday afternoon with a 7-6 victory over the Boston Red Sox in 12 innings.

The unsung hero of both of their wins this weekend might have been right-handed reliever Brad Brach, who tossed three scoreless innings Sunday in a tie game, keeping the Boston hitters at bay until the Orioles’ offense could rally.

And that happened in the 12th, when left fielder David Lough — who entered in the seventh as a defensive replacement when the Orioles held a seemingly comfortable four-run lead — opened the inning with a triple that rolled to the warning track in center in the deepest part of the outfield.

Shortstop J.J. Hardy then hit a run-scoring single to left field past a drawn-in infield to score the Orioles’ first run since the seventh inning.

Left-hander Zach Britton closed the door on the Red Sox in the 12th, ending a 5-hour 5-minute marathon — and the 30th inning between the two teams in the past two days — with his 14th save in 16 opportunities.

“That’s the kind of game that good teams win,” Orioles Manager Buck Showalter said. “I was thinking that in the dugout. It’s so easy just to say, ‘Boy, it wasn’t meant to be today,’ instead of making it happen.”

With the win, the Orioles (48-40) are a season-high eight games above .500 and remained atop the American League East standings. The Orioles won the series in Boston, and they have won 18 of their past 27 games at Fenway Park. The Orioles have won six of their past seven games overall and are 24-17 against division opponents this year.

Brach (4-0) allowed just two base runners — one hit and one walk — in three shutout innings. He struck out four batters and threw 45 pitches one day after he pitched 11 / 3 scoreless innings in their 7-4 doubleheader nightcap win when starter Ubaldo Jimenez lasted just 31 / 3 innings.

Brach has earned the win in four of his past seven appearances and has thrown 12 straight scoreless innings over that span. He quieted the Red Sox offensively after they rallied from a 6-1 deficit with a five-run seventh inning.

Right-hander Kevin Gausman had held the Red Sox scoreless for five innings and departed with one out in the sixth. After the Orioles chased Boston’s Jake Peavy from the game after six innings, the Red Sox battered four Orioles relief pitchers for five runs in the bottom half of the inning.

— Baltimore Sun