WASHINGTON (AP) – Starling Marte hit a solo home run in the 18th inning and the Pittsburgh Pirates beat the Washington Nationals 2-1 Sunday in a marathon game that lasted almost six hours.

Pinch-hitter Daniel Murphy homered with two outs in the ninth inning for Washington, and it took a long while until anyone scored again.

Marte’s seventh home run of the season helped end the series finale and the Pirates avoid getting swept by the NL East leaders. The only longer game in the majors this season came July 1 when Cleveland beat Toronto in 19 innings.

Marte made sure this wouldn’t go 19 by taking the first pitch from Oliver Perez (2-3) and sending it into the seats in left field. Jonathon Niese (8-6) survived a couple of singles to get the victory.

It was the longest regular-season game since the Montreal Expos moved to Washington and became the Nationals. The Nationals lost an 18-inning game to San Francisco in the 2014 playoffs.

By the time the 1:35 p.m. start ended at 7:23 p.m., stellar outings by Pittsburgh’s Chad Kuhl and Washington’s Max Scherzer felt like a distant memory.

Making his fourth major league start, Kuhl allowed one hit and two runners and struck out five in six shutout innings.

Scherzer gave up one run and six hits and struck out seven in seven efficient innings.

Join The Conversation On The KDKA Facebook Page
Stay Up To Date, Follow KDKA On Twitter

The Nationals were down to their last strike when Murphy, who leads the majors in hitting, connected on a 2-2 pitch from closer Mark Melancon for a long drive to right field.

Murphy, out of the lineup for the third consecutive day with a sore left hamstring, hit his 18th home run.

It was Murphy’s fourth career pinch-hit home run and first since April 27, 2011, when he was with the New York Mets, and the Nationals’ 10th of the season as a team. The blown save was Melancon’s second of the season and first since April 24.

TRAINER’S ROOM

Pirates: OF Gregory Polanco remained out with a sore left hamstring, but general manager Neal Huntington hopes he’ll play Tuesday against the Milwaukee Brewers. … C Francisco Cervelli was set to play another inning on a rehab assignment with Triple-A Indianapolis, and Huntington said “we’ll see” about him being back as soon as Tuesday.

Nationals: 3B Anthony Rendon was scratched with flu-like symptoms.

CHALLENGE ACCEPTED

Pirates manager Clint Hurdle successfully challenged two plays on the bases in the sixth. After a 91-second review in the top half, Marte was awarded his 32nd stolen base of the season, and Washington’s Danny Espinosa was called out on a steal attempt in the bottom half after a 31-second review.

UP NEXT

Pirates: After an off-day Monday, top pitching prospect Jameson Taillon (2-1, 3.86 ERA) is expected to start Tuesday at PNC Park against the Brewers. RHP Chase Anderson (4-10, 5.44) is scheduled to start the series opener for Milwaukee.

Nationals: The Nationals haven’t listed a starter for Tuesday’s game against the Los Angeles Dodgers. If RHP Joe Ross (7-4, 3.49) isn’t activated off the disabled list, RHP Lucas Giolito (0-0, 4.70) will make his third major league start against Dodgers LHP Scott Kazmir (7-3, 4.52).

(Copyright 2016 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.)