This Aug. 15, 2017 file photo shows Boston Red Sox’s Eduardo Nunez celebrating with teammates during a baseball game against the St. Louis Cardinals in Boston. (AP Photo/Charles Krupa, file)

FORT MYERS, Fla. (AP) — The Boston Red Sox have re-signed infielder Eduardo Nunez to a one-year contract with a player option for 2019, giving them another proven second baseman to fill in while Dustin Pedroia recovers from knee surgery .

Nunez’s deal was done on Sunday, the day before the Red Sox hold their first full-squad workout of spring training. He gets a guaranteed $6 million, according to multiple reports, including $4 million this season and a $2 million buyout. Nunez can reportedly exercise a $4 million option for 2019.

The 30-year-old batted a career-high .313 with 33 doubles and 12 home runs over 114 games last season between San Francisco and Boston. After being acquired by the Red Sox in a trade on July 25, Nunez made 25 of 38 starts at second base. He also hit eight homers in only 38 games for Boston.

“The time I was here last year was amazing,” Nunez told reporters at the team’s facility in Fort Myers, Florida. “There was a lot of energy, and I love to win. I think that’s the best thing, my first choice by far.”

Nunez was limited by a knee injury himself down the stretch last season, appearing in only two games after Sept. 9. One of those was in the AL Division Series.

A native of the Dominican Republic who was signed by the New York Yankees in 2004, Nunez was traded to the Minnesota Twins in 2014. There he found more playing time at his natural shortstop position and made his first All-Star team in 2016. Then he was traded to the Giants a few weeks later. Nunez has played almost as much third base as he has shortstop over his eight-year major league career. In addition to second base, he has also played left field, right field and designated hitter.

To make room for Nunez on the 40-man roster, the Red Sox designated right-handed pitcher Ben Taylor for assignment. Taylor was on the opening day roster last season and posted a 5.19 ERA in 17 1/3 relief innings.