Tampa Bay Rays third baseman Evan Longoria is embraced by Brad Miller (13) after the Rays defeated the Boston Red Sox in a baseball game at Fenway Park, Tuesday, Aug. 30, 2016, in Boston. Longoria scored the go-ahead run on a home run, breaking a 3-3 tie, in the Rays' 4-3 win. (AP Photo/Charles Krupa)
Tampa Bay Rays third baseman Evan Longoria is embraced by Brad Miller (13) after the Rays defeated the Boston Red Sox in a baseball game at Fenway Park, Tuesday, Aug. 30, 2016, in Boston. Longoria scored the go-ahead run on a home run, breaking a 3-3 tie, in the Rays' 4-3 win. (AP Photo/Charles Krupa) Credit: Charles Krupa

BOSTON – Evan Longoria broke a tie with a solo homer in the eighth inning, clearing Fenway Park’s “Green Monster” and rallying Tampa Bay to a 4-3 victory over the Boston Red Sox on Tuesday night.

Luke Maile of the Rays hit a two-run homer with two outs in the seventh. It was just the second career homer for Maile, who drove a 1-2 pitch from Drew Pomeranz out to left to restore the tie after Boston had taken a 3-1 lead.

Pomeranz and Tampa Bay starter Jake Odorizzi both pitched well but didn’t factor in the decision as both bullpens struggled to hold a lead.

Enny Romero (2-0) pitched a scoreless seventh with two strikeouts and got the win. Alex Colome survived a hit and a passed ball in the ninth while picking up his 29th save.

Former starter Clay Buchholz (5-10) took the loss, pitching the eighth and allowing Longoria’s solo shot.

Hanley Ramirez hit a homer in the fifth for Boston’s first run and added an RBI single in the sixth when Boston scored twice to take a 3-1 lead.

Boston took its first lead in the sixth after Dustin Pedroia walked with one out and went to third on Xander Bogaerts’ double down the left-field line. Pedroia tagged up and scored on David Ortiz’s sinking fly ball to right, where Steven Souza Jr. prevented another run with a diving catch.

Boston ended up getting the run anyway on an odd single by Ramirez, whose towering popup to shallow right landed safely between Souza and first baseman Brad Miller.

Maile tied it with a two-run homer to left with two outs in the seventh. Maile’s second career homer came on the last pitch from Pomeranz, who was one strike away from cruising into the eighth with a two-run lead.

Pomeranz struck out eight in 6 innings, allowing three runs, five hits and two walks. Odorizzi allowed three runs and five hits in six innings, striking out seven and walking two.

Trainer’s room

Red Sox: OF Andrew Benintendi has been fitted for a brace for his sprained left knee. Manager John Farrell it will take about a week to construct the custom brace that will allow the rookie to increase the intensity of his rehab workouts. Benintendi injured the knee last Wednesday in a loss at Tampa Bay.

Up next

Rays: LHP Drew Smyly (6-11, 4.80 ERA) starts for the Rays in the series finale Wednesday afternoon. Smyly is 4-0 in his last seven starts with three no-decisions. Smyly has pitched at least six innings during the seven-game span.

Red Sox: RHP Steven Wright (13-6, 3.18) will make his first career start against the Rays. The knuckleballer took the loss Friday against Kansas City, allowing five runs and seven hits in six innings.