Left-handed reliever Felipe Rivero is headed to Pittsburgh as part of the deal, according to reports. The trade was first reported Saturday by Fox Sports.
Melancon, 31, is 1-1 with a 1.51 ERA and 30 saves this season. The right-hander likely will serve as the closer in Washington, which has struggled lately in late-inning situations.
Jonathan Papelbon was pulled in the ninth inning of Thursday's game against the San Francisco Giants and took the loss in two other games over the past week. The Nationals have used reliever Shawn Kelley to close out their last two games.