NASHVILLE, Tenn. (AP) Right-hander David Hernandez and the Philadelphia Phillies have agreed to a $3.9 million, one-year contract.

The 30-year-old was 1-5 with a 4.28 ERA in 40 relief appearances for Arizona this year, striking out 33 in 33 2-3 innings. He returned to the major leagues in June following Tommy John surgery in April 2014.

Hernandez is 25-35 with 19 saves and a 4.15 ERA in 309 games over six major league seasons with the Baltimore Orioles (2009-10) and the Diamondbacks (2011-15). He worked his way up the Orioles system when Andy MacPhail, the Phillies' new president of baseball operations, was with Baltimore.

Philadelphia announced the deal Wednesday at the winter meetings. Hernandez can earn $1 million in performance bonuses: $250,000 each for 35, 40, 45 and 50 games finished.