Mark Melancon spent the second half of the 2016 season with the Washington Nationals, but the 31-year-old closer is moving on from the reigning National League East champions after signing with the San Francisco Giants on Monday.

The Giants announced the deal Monday after Buster Olney of ESPN first reported the agreement. Melancon would comment on the news via Twitter: 

Ken Rosenthal of Fox Sports reported the contract is for four years and $62 million. The deal includes an opt-out clause after the second season, according to Jeff Passan of Yahoo Sports. Alex Pavlovic of CSN Bay Area broke down the financial terms:

Olney noted Melancon’s deal is a record one, but he spoke to a National League evaluator who said “that’ll soon be broken.”

The Nationals acquired the three-time All-Star from the Pittsburgh Pirates on July 30 to help fortify the closer’s role in the nation’s capital.

After Melancon recorded 30 saves, a 1.51 ERA and a 0.960 WHIP in 45 appearances with the Pirates, he proceeded to hold down the fort with the Nationals.

Melancon notched 17 saves for Washington while finishing 28 games and appearing in 30 in total. By the time his two-month stint in D.C. came to a close, Melancon had notched a 1.82 ERA and 0.809 WHIP.

He finished an MLB-best 67 games thanks to a three-pitch arsenal comprised of a fastball, wicked cutter and curveball, according to FanGraphs.

Speaking to reporters in August, Melancon credited his time with the New York Yankees and famed closer Mariano Rivera for the development of his cutter.

“I was in the pen with Mariano,” Melancon said. “I got to watch that a lot from him and just sit behind the plate, sit behind him pitching, and not only did I notice how important the cutter and the movement and when to throw it in, backdoor it and all that stuff, but just his location and how important that was.”

Based on the way Melancon performed a season after he tallied a major league-best 51 saves, targeting him in free agency was a no-brainer for the Giants since they ranked 15th in bullpen ERA (3.65) among all MLB teams in 2016.

Bringing Melancon aboard also gives the Giants some peace of mind at the back end of their bullpen.

San Francisco blew an MLB-high 30 saves last season, which contributed to a woeful 58.9 save percentage. Only five teams recorded lower save percentages.

That number figures to improve if Melancon can replicate the success he’s experienced over the past couple of years once he arrives in the Bay Area.

Read more MLB news on BleacherReport.com