For 4 hours, 4 minutes Monday night, the Pirates flat-out wore down the San Diego Padres’ pitching staff. They saw 249 pitches. Of the 53 men they sent to the plate, 26 reached base. They went 9 for 20 with runners in scoring position yet somehow managed to strand 16 men on base in a game that set the record for the longest ninth-inning home game in Padres franchise history.

The end result was a 10-3 win at Petco Park, the Pirates’ fourth victory in five games.

“The hitters are part to credit for it,” manager Clint Hurdle said. “We just went up there and dug in and battled.”

The Pirates touched up Padres pitching, from starter Tim Stauffer to the six relievers that followed, by relentlessly putting men on base. Jordy Mercer’s four hits tied a career high, and one of them left the ballpark for his second homer of the season. Josh Harrison and Neil Walker each had three hits, and Gaby Sanchez and Andrew McCutchen each hit RBI doubles.

When Mercer heard how many pitches the Padres threw, he chuckled.

“We laid off some tough pitches that they threw, made them throw it over the plate and we didn’t miss our shot,” he said.

Walker drove in an insurance run in the sixth to increase the Pirates’ lead to 4-2, but Russell Martin struck out looking with the bases loaded to end the inning.

That was a theme for the Pirates Monday. After they scored two runs in the third inning, Pedro Alvarez struck out with the bases loaded, and McCutchen grounded into an inning-ending double play with the bases full in the fourth.

In the seventh, that changed. Harrison singled with the bases loaded to drive one run in and Walker doubled to score two more.

Charlie Morton held the Padres hitless through four, but walked two batters, hit two more and committed an error that allowed a fifth man to reach base.

The Padres saved their hits for the fifth inning, which they entered trailing, 3-0, before stringing together three hits to score two runs. Alexi Amarista singled and scored on Everth Cabrera’s double to the gap in left-center. Seth Smith’s RBI single reduced the Pirates’ lead to 3-2.