Center fielder Enrique Hernández and the Boston Red Sox agreed on a one-year, $10 million contract extension Monday, keeping the 31-year-old in the city where he starred in the 2021 postseason, sources told ESPN.

A hip-flexor injury sidelined Hernández for more than two months this season and contributed to his struggles on the field after his career year in 2021. Hernández is batting .219 with a .637 OPS and has only six home runs in more than 300 plate appearances in the final season of a two-year, $14 million contract.

Hernández was due to hit free agency this winter and was coming off a season in which he hit .250/.337/.449, played elite defense in center field and compiled 4.9 Baseball-Reference wins above replacement (and 4.1 from FanGraphs).

In the Red Sox's run to the cusp of the World Series last year, Hernández was the team's best player. In the American League Division Series against Tampa Bay, he batted .450 and slugged .900 with two home runs. He nearly equaled those numbers in the AL Championship Series, hitting .385/.407/.846 with three solo homers.

Originally projected to be a superutility player, Hernández emerged as a defensive stalwart in center field for Boston, though that hasn't stopped the Red Sox from also using him at shortstop and second base this season. The right-handed-hitting Hernandez also played first and third base and both corner-outfield spots in Los Angeles, where he spent six seasons with the Dodgers.

Hernández, who was drafted in the sixth round by Houston in 2009 out of his native Puerto Rico, was set to be one of a slew of free agents for the Red Sox, who are expected to have one of the busiest offseasons in baseball. Currently in last place in the AL East at 67-69, Boston faces a winter in which star shortstop Xander Bogaerts is expected to opt out of his contract and starters Nathan Eovaldi, Michael Wacha and Rich Hill, plus reliever Matt Strahm, will be free agents.

The Red Sox will have less than $60 million committed to their 2023 payroll if Bogaerts opts out. They also could look to extend 25-year-old All-Star third baseman Rafael Devers, who is set to hit free agency following the 2023 season.