SAN FRANCISCO — None of the Tampa Bay Rays wanted to see their old pal Evan Longoria in the batter’s box with the game on the line in the ninth inning and two outs.

This time, Longoria flied out to end the game facing his former team for the first time since being traded in December 2017.

“He took a good swing, though,” Rays Manager Kevin Cash said.

Yandy Diaz and Kevin Kiermaier hit back-to-back home runs in the first inning and Tampa Bay spoiled the San Francisco Giants’ home opener with a 5-2 win Friday for the best start in Rays’ franchise history.

The Rays (6-2) got four straight two-out hits in the first against Dereck Rodriguez (1-1). Given a 4-0 cushion, Tyler Glasnow (2-0) pitched six scoreless innings, allowing three hits and striking out six.

Rays reliever Adam Kolarek hit Brandon Crawford to load the bases with none out in the eighth. Diego Castillo came in one out later and got Giants newcomer Kevin Pillar to ground into a double play. Jose Alvarado finished for his third save, getting Longoria with two runners on.

“I love Longo, but I was hoping it wasn’t a storybook,” Kiermaier said. “The stars always align in certain situations, of course he had a chance to be the hero.”

PHILLIES 10, TWINS 4: Rhys Hoskins had three hits and drove in four runs, including Bryce Harper from first base on a single, and Philadelphia won at home despite Jorge Polanco hitting for the cycle for Minnesota.

Nick Pivetta (1-0) gave up four runs – three earned – and nine hits in five innings.

AMERICAN LEAGUE

WHITE SOX 10, MARINERS 8: Yoan Moncada hit a go-ahead, two-run single in the seventh inning and Chicago won a wild home opener.

A day after their home opener was postponed because of inclement weather, the White Sox ended Seattle’s four-game winning streak. The Mariners had been off to a franchise-best 7-1 start.

INDIANS 3, BLUE JAYS 2: Carlos Santana homered with one out in the ninth inning, leading Cleveland at home in a game that featured little hitting and 24 combined strikeouts.

Santana, who returned to the Indians via trade this season after signing with Philadelphia as a free agent last year, connected on a 1-0 pitch off Joe Biagini (0-1) to give Cleveland its first walk-off win of 2019.

NATIONAL LEAGUE

DODGERS 10, ROCKIES 6: Max Muncy, Cody Bellinger and Russell Martin homered at Denver in the Rockies’ home opener.

After hitting a franchise-record 235 home runs last year, the NL champion Dodgers have connected 21 times in eight games this season.

PADRES 5, CARDINALS 3: Rookie Fernando Tatis Jr. and pinch-hitter Hunter Renfroe homered at St. Louis as San Diego overcame Paul Goldschmidt’s fifth homer in seven games and spoiled the Cardinals’ home opener.

Goldschmidt connected in the eighth inning off Trey Wingenter.

PIRATES 2, REDS 0: Joe Musgrove allowed three hits in seven efficient innings to outduel Sonny Gray as Pittsburgh, at home, handed Cincinnati its third straight shutout.

Musgrove (1-0) struck out eight and walked one in his first start as Pittsburgh sent Cincinnati to its sixth straight loss.

BRAVES 4, MARLINS 0: Kevin Gausman allowed only two hits in seven innings, Ronald Acuna Jr. and Tyler Flowers homered and Atlanta won at home.

The Braves escaped a bases-loaded jam in the ninth and won their fourth straight. Miami has lost four straight, and nine consecutive games in Atlanta.

NOTES

ORIOLES: Seeking to boost a thin starting rotation, Baltimore agreed to a $575,000, one-year contact with Dan Straily.

RANGERS: Texas put pitcher Edinson Volquez on the 10-day injured list because of a sprained right elbow.