BUFFALO, N.Y. (AP) - For the city of Buffalo, it was fun while it lasted.

After not hosting a Major League Baseball game since its days as a Federal League outpost in 1915, Buffalo made the most of its opportunity, hosting the Toronto Blue Jays over two seasons because of coronavirus concerns.

It all ended Wednesday night, as J.D. Martinez and Hunter Renfroe connected back-to-back to help the Boston Red Sox won a home run derby, beating Toronto 7-4 in the final MLB game to be played in the city for the foreseeable future.

In the middle of the third inning, Toronto players and coaches came out of the dugout to salute the fans at Sahlen Field.

In the end, there was no mistaking the finality of the Blue Jays' tenure along Lake Erie as Simon & Garfunkel's “Homeward Bound” played on the stadium's sound system just after Boston finished its on-field celebration.

The Blue Jays will return to Toronto on July 30 after the Canadian government granted them an exemption to the U.S.-Canada travel ban. The Blue Jays haven't played at Rogers Centre since 2019 because of coronavirus protocols.

“It's been a good ride here,” Blue Jays manager Charlie Montoyo said. “We're never going to forget that this was the place where we clinched the playoffs last year. The crowds have been great. It was a great idea by our crew (to thank the fans).”

Kike Hernandez, Rafael Devers and Michael Chavis also connected for Boston, which went deep six times in Monday's 13-4 win over Toronto. It was the first time the Red Sox hit at least five homers in consecutive games against one opponent since doing it to the Yankees in June 1977.

“We did an amazing job, coming here against a tough team,” said Boston manager Alex Cora, whose club scored just six runs in three games in New York against the Yankees before sweeping Toronto. “We ended up 3-2 on this road trip, so it was a positive one for how bad it supposedly looked over the weekend.”

Hernandez, who has nine homers in his last 25 games after being held without one in 23 previous games, can't explain the turnaround.

“I don't have a secret,” Hernandez said. “I'm just trying to get good at-bats, make good decisions at the pitches that I want to swing at. And it's going well for me right now. I'm just going to try and do my job.”

Vladimir Guerrero Jr. hit his 32nd homer for Toronto. George Springer added a two-run shot in the sixth and Teoscar Hernandez followed with a homer for Toronto, which finished its residency in Buffalo with a 12-11 record this season.

Including games played at the home of their Triple-A team in 2020, the Blue Jays ended with a 29-20 mark in Buffalo. Their game against Boston on Tuesday night was rained out.

Before the game, Blue Jays president Mark Shapiro presented a check for $25,000 to the Buffalo Bisons Charitable Foundation in thanks for the support provided by Toronto's top minor league affiliate.

Buffalo fans returned the favor, as crowds in excess of 10,000 turned out for six of Toronto's last eight home games, with Wednesday's attendance of 14,607 topping the ledger.

Toronto began this season hosting home games at its spring training site in Dunedin, Florida, then moved to Buffalo in June.

Hernandez hit a two-run shot in the third inning, and Devers and Chavis hit leadoff drives in the fourth and fifth innings. Martinez and Renfroe connected in the eighth as Boston raised its AL-leading road record to 30-19.

Garrett Richards (6-5) allowed four hits in 5 2/3 innings and won a second straight start for the first time since mid-May. He struck out four.

Garrett Whitlock pitched 1 1/3 innings and Adam Ottavino worked the eighth. Matt Barnes pitched a perfect ninth for his 20th save.

“We pitched well the whole road trip,” Cora said. “The bullpen was amazing. (Richards) was pounding the strike zone, changing speeds, using both sides of the plate. We loved what we saw.”

Robbie Ray (8-5) allowed the first three Boston homers and struck out four over five innings in the loss, his shortest outing since a 4 2/3-inning stint on June 18 at Baltimore.

Toronto's Danny Jansen left the game after his seventh-inning double, pulling up after rounding first with hamstring tightness. On the hit, Boston's Danny Santana stumbled in left field after trying to reach for the ball and left the game with right groin tightness.

TRADE WINDS

The Blue Jays traded RHP Joel Payamps to the Kansas City Royals for cash. Payamps, a 27-year old rookie, was 0-2 with a 2.70 ERA in 22 appearances with Toronto before being optioned to Triple-A Buffalo and then designated for assignment.

TRAINERS ROOM

Red Sox: LHP Chris Sale (Tommy John surgery) struck out six in 3 2/3 hitless innings on Tuesday in his second rehab start for Double-A Portland. “He was a little bit off mechanically early on,” Cora said. “That's part of the progression. He settled down and he was able to repeat his delivery. Everybody's very happy with the way the outing went.” ... RHP Ryan Brasier (left calf strain) has resumed baseball activities, but Cora said it “will not be easy. It's going to be a process.”

Blue Jays: RHP Alex Manoah (right back contusion) is expected to make his next start on Monday in Boston when he's eligible to be activated from the 10-day injured list. ... RHP Julian Merryweather (strained left oblique) has continued his throwing progression in Florida after having a setback in his recovery.

UP NEXT

Red Sox: Return home for a four-game series against the Yankees. RHP Tanner Houck (0-2, 3.38 ERA) is scheduled to start for the Red Sox on Thursday night against New York LHP Jordan Montgomery (3-5, 4.18).

Blue Jays: Will be off Thursday before taking on the New York Mets in the opener of a seven-game road trip on Friday. Toronto LHP Steven Matz (8-4, 4.43), who appeared in 112 games for the Mets from 2015-20, will oppose Mets RHP Tylor Megill (0-0, 2.63).