San Francisco Giants' Gorkys Hernandez follows through with his swing after connecting for a solo home run off Colorado Rockies starting pitcher Tyler Anderson in the third inning of a baseball game Monday, Sept. 3, 2018, in Denver. (AP Photo/David Zalubowski)
San Francisco Giants' Gorkys Hernandez follows through with his swing after connecting for a solo home run off Colorado Rockies starting pitcher Tyler Anderson in the third inning of a baseball game Monday, Sept. 3, 2018, in Denver. (AP Photo/David Zalubowski) Credit: David Zalubowski

LAS VEGAS – Free agent outfielder Gorkys Hernandez and the Boston Red Sox have reached agreement on a minor league contract.

The deal Wednesday includes a spring training invite to big league camp with the World Series champions.

The 31-year-old Hernandez hit 15 home runs last season while batting .234 with 40 RBI in 142 games for San Francisco. In 2017, he didn’t hit a homer in 310 at-bats.

The Giants recently opted not to offer Hernandez a contract for 2019. New Giants president of baseball operations Farhan Zaidi said earlier this week at the winter meetings that his club was looking for an improved combination of on-base percentage and power in the outfield positions.

Hernandez has previously played for Pittsburgh and Miami.