Getting your Trinity Audio player ready...

The San Diego Padres scored early for a change Monday.

That didn’t keep them from having to play catch-up against the Chicago Cubs and hold on for the win.

Manny Machado doubled twice in a three-hit game, Ty France drove in four runs and the Padres survived rare misfires from both Randy Vásquez and Mason Miller in a 9-7 win in front of 41,478 at Petco Park.

Miller allowed three hits — one that looked like a foul ball when France picked it up outside of the chalk to start the ninth — while giving up two runs in a non-save situation to see his franchise-record scoreless streak snapped at 34 2/3 innings.

Machado’s two doubles upped his career total to 400, but he exited after a sixth-inning groundout — three innings after he appeared to pull up lame with discomfort in his left leg after sliding into second base with his first double.

France went 2-for-3 with a double, a triple and four RBIs — his most in a game since September 2022 — and Fernando Tatis Jr. and Xander Bogaerts both finished with two hits as the Padres outhit the Cubs 14-8 in a comeback that was required even after ambushing Cubs left-hander Matthew Boyd.

A three-run first equaled the three runs the Padres had scored in the first inning through the first 27 games.

Ramón Laureano walked to start the game and advanced to second on Tatis’ groundout before Jackson Merrill pulled a one-out single to left to send him home. After Machado singled, Miguel Andujar walked with two outs to load the bases for France, who lined a ground-rule double to left field to open a 3-0 lead.

The first of Machado’s two doubles led to a run in the third via an RBI groundout from Andujar. The second chased Boyd from a game with an entirely different feel than the last time he faced the Padres, when Laureano’s broken finger kept him from the lineup last fall in the NL wild-card series.

A lefty-dependent lineup scored just five runs in three games, with Boyd starting that series with 4 1/3 innings of one-run ball.

On Monday, Boyd was chased after four-plus innings with five runs allowed on eight hits and two walks.

Ben Brown relieved Boyd and recorded the first two outs before a passed ball allowed Machado to take third. France then walked and swiped second, and Nick Castellanos cashed in both runners with his first hit since April 11.

Granted, he had played in just five games since — and not once in Mexico City’s altitude — but Castellanos’ single snapped a 0-for-19 rut and gave the Padres a 6-5 lead.

France’s triple down the third-base line plated two insurance runs in the seventh. Gavin Sheets, who replaced Machado in the lineup, added a solo shot in the eighth.

The Cubs’ five runs off Vásquez all scored via home runs. He had allowed just one long ball in his first five starts, but Vásquez was tagged for a solo shot in the second by Seiya Suzuki and Moisés Ballesteros’ grand slam in the third, with all of the traffic accumulating after Vásquez recorded the first two outs of the inning.

Alex Bregman walked, France couldn’t cleanly field a ball to his right off the bat of Ian Happ and Suzuki loaded the bases with a sharp single to left.

Vásquez’s next pitch was a belt-high slider on the inside edge of the plate, and Ballesteros yanked it out to right field to give the Cubs a 5-3 lead.

The five runs were a season high for Vásquez, who completed five innings before giving way to the bullpen.

Vásquez (2.94 ERA) struck out four while allowing five runs on five hits and three walks. He threw 71 of his season-high 106 pitches for strikes.

The bullpen took it from there, with Adrián Morejón recording five outs, Jason Adam fetching four and Miller getting the last three after his franchise-record scoreless streak ended.