Melancon, who was sidelined nearly two weeks in May with a right pronator strain, had a recurrence of the injury. The Giants recalled right-hander Dan Slania from Double-A Richmond in a corresponding move.
San Francisco manager Bruce Bochy said Wednesday that Sam Dyson would fill the closer role until further notice.
Signed to a four-year, $62 million deal in the offseason as a free agent, Melancon has been a bust in the Bay Area.
"He threw great last time -- good stuff," Bochy said Wednesday. "But it showed up and he could really feel it. We need to get this behind us."
Since returning to the Giants on May 19, Melancon allowed seven earned runs in 10 innings. He has 11 saves with a 1-2 record and 4.35 ERA this season.
Last season, Melancon saved 47 games in 71 1/3 innings pitched and compiled a 1.64 ERA with the Nationals and Pirates.