PHILADELPHIA -- For months, it has been clear that Farhan Zaidi would deal relievers. But this is not what was expected. 

The Giants have agreed to trade right-hander Mark Melancon to the Atlanta Braves, ESPN's Jeff Passan and Buster Olney first reported Wednesday. The Athletic's Robert Murray reported that the Giants will receive pitching prospect Tristan Beck and major-league reliever Dan Winkler from Atlanta.

The Giants later confirmed the transaction

Melancon has a full no-trade clause and is still owed nearly $20 million, but Giants president of baseball operations Farhan Zaidi told reporters that the Braves are picking up all of Melancon's contract.

Melancon signed a four-year, $62 million contract after the 2016 season that was at the time the largest ever given to a relief pitcher. It didn't work out from the start, as a pronator injury limited Melancon in his first two seasons and he fell short of previous numbers. 

Melancon has recovered this season to give the Giants some value while primarily pitching as one of the first right-handers out of the bullpen. He entered deadline day with a 3.50 ERA in 43 appearances.