PHILADELPHIA (AP)Max Scherzer finally could pitch with all his strength now that his right hamstring wasn’t bothering him anymore.

It took a bit for him to figure that out, but when he did, he looked back to his Cy Young self.

Scherzer settled in after working out of an early jam, Pete Alonso drove in five runs with a homer and two doubles and the New York Mets beat the Philadelphia Phillies 9-6 Wednesday. It took loading the bases in the first for Scherzer (2-0) to recalibrate how to pitch on his right leg again, then he struck out the next batter, induced a groundout and allowed one run and five hits with seven strikeouts in five innings.

”I just wasn’t completely executing every pitch where it needed to be,” Scherzer said. ”Fortunately enough to be able to walk three in an inning to not have that spiral out of control and give up a bunch of runs in that situation. That really set a tone and allowed our offense to get going.”

Alonso and the rest of New York’s offense provided more than enough run support for the 37-year-old three-time Cy Young Award winner. Brandon Nimmo hit a solo home run off Aaron Nola in the third inning – the first Mets hit of the afternoon – before the middle of the order teed off in the fourth and fifth.

”We did an excellent job of pouring it on all day,” said Alonso, who was again the designated hitter instead of his preference to play first base. ”We had excellent at-bats one through nine, and that’s what it takes to win these tough, divisional games.”

Alonso’s first RBI double helped knock Nola out of the game. The right-hander also lost command in the fourth, walking a batter and hitting two more to load the bases and get the hook from manager Joe Girardi. Nola (1-1) allowed three earned runs on three hits in 3 1/3 innings.

The Mets also knocked around the Phillies bullpen, which went five relievers deep after Nola’s short start and with an off day coming up. Alonso drilled a three-run homer run to right-center in the sixth to make it 8-1 and close Scherzer’s day after throwing 96 pitches.

”That was a big moment in the game that kind of put us ahead by a bunch, and thankfully that was enough,” Alonso said. ”Philly has a great offense. They’re a great team. They started to come back there. But I feel like coming through like that for the team was huge.”

All nine batters who started the game for New York reached base at least once. Philadelphia got to the Mets bullpen in the later innings, with Nick Castellanos hitting an RBI double and reigning NL MVP Bryce Harper launching his first home run of the season to make it interesting before Edwin Diaz closed it out.

SEGURA INJURED

Phillies second baseman Jean Segura left in the sixth after getting hit by a pitch in his left forearm. He walked to first base and was attended to by a trainer before coming out of the game.

PHILIES ROSTER MOVES

After the game, the Phillies optioned right-hander Connor Brogdon and left-hander Damon Jones to Triple-A and activated right-hander James Norwood off the bereavement list.

METS LINEUP FLIP

Manager Buck Showalter flipped Francisco Lindor into the second spot in the lineup with Starling Marte batting third. Lindor doubled and scored in the fifth, while Marte had an RBI single in the sixth.

QUICK CAMEO

Closer Corey Knebel’s return from the COVID-related injured list meant the end of 28-year-old journeyman reliever Jeff Singer’s brief time with his hometown Phillies. The South Jersey native who was working with his father at a Northeast Philadelphia car dealership in 2016 when the team signed him got to sit in the bullpen Tuesday night and had dozens of friends and family in attendance for his first game in a major league uniform.

”He got to fulfill a lifetime dream, and I think that was a special day for him,” Girardi said. ”It could be just the start of things to come.”

TRAINER’S ROOM

Mets: Showalter hopes right-handed reliever Trevor May can dodge the injured list with a minor triceps strain and expects the right-hander to benefit from the team’s day off Thursday.

Phillies: OF Odubel Herrera (strained right oblique) began a rehab assignment at Single-A Clearwater on Tuesday. Girardi said Herrera got four at-bats in his first game with the Threshers as the designated hitter and was scheduled to play five innings in center field Wednesday.

UP NEXT

Mets: Chris Bassitt is set to start Friday afternoon against the Arizona Diamondbacks in the home opener at Citi Field.

Phillies: Kyle Gibson takes the mound Friday night for the opener of a three-game series at the Miami Marlins.

More AP MLB: https://apnews.com/hub/MLB and https://twitter.com/AP-Sports