The Arizona Diamondbacks and pitcher David Hernandez have agreed to terms on a two-year contract on Sunday.

Hernandez is 0-1 with two saves and a 2.90 earned run average in 33 relief appearances this season.

In 168 career games (27 starts) with the Orioles (2009-10) and Diamondbacks (2011-present), Hernandez is 17-22 with 15 saves and a 4.32 ERA. He has 262 strikeouts and 130 walks.