Pittsburgh Pirates closer Mark Melancon (35) celebrates with catcher Elias Diaz after getting the final out of a baseball game against the Philadelphia Phillies in Pittsburgh, Sunday, July 24, 2016. Melancon got his 30th save in the Pirates 5-4 win. (AP Photo/Gene J. Puskar)
Pittsburgh Pirates closer Mark Melancon (35) celebrates with catcher Elias Diaz after getting the final out of a baseball game against the Philadelphia Phillies in Pittsburgh, Sunday, July 24, 2016. Melancon got his 30th save in the Pirates 5-4 win. (AP Photo/Gene J. Puskar) Credit: Gene J. Puskar

SAN FRANCISCO – The Washington Nationals found a reliable pitcher for the ninth inning, acquiring All-Star closer Mark Melancon from the Pittsburgh Pirates on Saturday.

Washington sent reliever Felipe Rivero and pitching prospect Taylor Hearn to the Pirates for Melancon, who supplants struggling Jonathan Papelbon as Washington’s closer. Melancon is expected to join the Nationals today for their series finale at San Francisco.

This isn’t the first time Melancon has been brought in to replace Papelbon as the closer. The Boston Red Sox traded Jed Lowrie and Kyle Weiland for Melancon to replace a struggling Pabelbon in 2011.

A 31-year-old right-hander, Melancon has converted 30 of 33 saves with a 1.51 ERA this season and joins his fifth organization in eight years. He is making $9.65 million and will be eligible for free agency.

Once considered a possible successor to Mariano Rivera when he broke into the majors with the New York Yankees in 2009, Melancon said during the All-Star break he knew a trade was possible, given his contract status.

Papelbon, the 35-year-old righty, has a career-high 4.41 ERA this season with 19 saves in 22 opportunities.